Rob Dixon wrote:
If you think the one-liner is non-trivial then all the more reason that you
should use a proper script. It is a bad idea to use any code unless you
understand why and how it works.
The script isn't trivial (to me) either. Incidentally the same can be done in
sed one-liner.
sed -i -e 'N;s/aa\nbb/aa\ncc\nbb/g' foo.txt
I was not sure if perl had the same multi-line mode however neither m or s
switch is effective in pie mode, (I'm happy to know if it can be done).
regard,
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/