in reply to Re: Re: reading/writing line by line
in thread reading/writing line by line
Can that be used for multiple regexes in a file? Like, if you wanted to do s/foo/bar/g and s/y/yah/g on the same file?
Yes. See what happens if you use just perl -pe'undef':
So you can just add whatever should be inside the block:LINE: while (defined($_ = <ARGV>)) { undef; } continue { die "-p destination: $!\n" unless print $_; }
perl -i -pe's/foo/bar/g; s/y/yah/g;' filename
- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
thank you! Re: reading/writing line by line
by amarceluk (Beadle) on May 22, 2002 at 19:51 UTC |