pret_23_1 has asked for the wisdom of the Perl Monks concerning the following question:
newyork 1536000 13 56 california 1536000 67 45 London 456 newyork 1536000 78 87
when i print the line the value is changed but when i vi the file it still has the old value..any help of what's going wrong ..open FILE, "+< test.cfg" || die "Cannot open file\n" ; while ($line = <FILE>) { if ($line =~ /newyork/ ) { $line =~ s/1536000/7878787878/; print " the line is $line"; } } close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: reg perl substitution
by moritz (Cardinal) on Nov 09, 2007 at 17:57 UTC | |
|
Re: reg perl substitution
by tuxz0r (Pilgrim) on Nov 09, 2007 at 19:22 UTC | |
|
Re: reg perl substitution
by mwah (Hermit) on Nov 09, 2007 at 19:17 UTC | |
|
Re: reg perl substitution
by ikegami (Patriarch) on Nov 10, 2007 at 02:38 UTC | |
|
Re: reg perl substitution
by Anonymous Monk on Nov 09, 2007 at 19:28 UTC | |
by johngg (Canon) on Nov 09, 2007 at 19:55 UTC | |
by mwah (Hermit) on Nov 09, 2007 at 19:45 UTC |