in reply to Word Replacing
If you just want to replace a word, you don't even need a script:
perl -pi.orig -e 's/original/substitute/g' <filename>Update: If you want to get your script working, you should iterate over all lines in the file, and not just work with the first line.
Each time you read something from <FILEHANDLE> in scalar context it reads one line.
Perhaps you should find a good book to learn Perl from.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Word Replacing
by blazar (Canon) on May 31, 2007 at 13:40 UTC | |
| |
|
Re^2: Word Replacing
by xoddam (Novice) on May 31, 2007 at 13:29 UTC | |
by blue_cowdawg (Monsignor) on May 31, 2007 at 13:34 UTC | |
by blazar (Canon) on May 31, 2007 at 13:32 UTC |