Re: pie multiline replace

[email protected] (bill lam)
Newsgroups perl.beginners
Message-ID <[email protected]>
Thomas Bätzler wrote:
> perl -i -ple '$_ = "cc\n$_" if $p =~ m/aa/ && m/bb/; $p=$_'

Thanks. looks non-trivial for me. Anyway I will copy this idiom into my cheat sheet.

Thank Gunnar for suggestion too. However I prefer one-liner.

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.