hello99hello
Programmer
I have this array, and I am trying to change the value of the 4th element. Here is my code:
chomp($array[3]);
if ($array[3] = 'BRO.IN LAW') {
$array[3]= "Brother-in-law";
chomp($array[3]);
print "The new value is $array[3] \n";
}
However, it chages the values to "Brother-in-law" for all the 4th elements of all records in the file.
How can I get it to only change values for the records where the 4th element is 'BRO.IN LAW'.
chomp($array[3]);
if ($array[3] = 'BRO.IN LAW') {
$array[3]= "Brother-in-law";
chomp($array[3]);
print "The new value is $array[3] \n";
}
However, it chages the values to "Brother-in-law" for all the 4th elements of all records in the file.
How can I get it to only change values for the records where the 4th element is 'BRO.IN LAW'.