ChuckularOne has asked for the wisdom of the Perl Monks concerning the following question:
I know the file is being written too, because it is being changedopen (FILE2, ">$file"); foreach $setting (@settings) { foreach $item (@lines) { chomp($setting); ($setMode, $setSect, $setPair) = split(/ *\| */, $setting); ($setName, $setVal) = split(/ *= */, $setPair); print "$setMode||$setSect||$setPair\n"; chomp($item); if ($item =~ m/ *= */) { ($temp1, $temp2) = split(/ *= */, $item); if ($setName eq $temp1) { $temp2 = $setVal; } #problem area $lineout = "$temp1 = $temp2\n"; print FILE2 "$lineout"; print "$lineout"; #end problem area } else { print "$item\n"; print FILE2 "$item\n"; } } close (FILE2);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hopefully a simple mistake
by chromatic (Archbishop) on Apr 14, 2000 at 00:30 UTC | |
by ChuckularOne (Prior) on Apr 14, 2000 at 02:07 UTC | |
|
RE: Hopefully a simple mistake
by Doc Technical (Initiate) on Apr 14, 2000 at 00:53 UTC | |
|
Re: Hopefully a simple mistake
by stephen (Priest) on Apr 14, 2000 at 01:18 UTC | |
|
Re: Hopefully a simple mistake
by btrott (Parson) on Apr 14, 2000 at 00:37 UTC | |
|
Re: Hopefully a simple mistake
by turnstep (Parson) on Apr 14, 2000 at 01:21 UTC | |
|
RE: Hopefully a simple mistake
by Anonymous Monk on Apr 15, 2000 at 02:23 UTC | |
by ChuckularOne (Prior) on Apr 15, 2000 at 16:34 UTC |