Kelicula has asked for the wisdom of the Perl Monks concerning the following question:
What am I doing wrong? I tried opening the file with ">>" and "+>>", to no avail. ???open (FIL, "+<stuff.txt") or die "$!"; foreach $line (<FIL>){ if($line =~ m/David/){ $line =~ s/David/Josh/; } print $line; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: substitution in files
by Anonymous Monk on Aug 25, 2007 at 02:24 UTC | |
|
Re: substitution in files
by wind (Priest) on Aug 25, 2007 at 02:42 UTC | |
|
Re: substitution in files
by Cody Pendant (Prior) on Aug 25, 2007 at 04:54 UTC | |
|
Re: substitution in files
by dwm042 (Priest) on Aug 25, 2007 at 03:30 UTC | |
|
Re: substitution in files
by hilitai (Monk) on Aug 25, 2007 at 23:31 UTC |