Re: pie multiline replace

[email protected] (bill lam)
Newsgroups perl.beginners
Message-ID <[email protected]>
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,
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.