$ cat 2 1 2 3 4 $ perl -i.orig -p -l -e "print 'three' if /3/" 2 $ cat 2 1 2 three 3 4 $ cat 2.orig 1 2 3 4 $ perl -MO=Deparse -i.orig -p -l -e "print 'three' if /3/" BEGIN { $^I = ".orig"; } BEGIN { $/ = "\n"; $\ = "\n"; } LINE: while (defined($_ = <ARGV>)) { chomp $_; print 'three' if /3/; } continue { print $_; } -e syntax OK
In reply to Re: append middle of File
by Anonymous Monk
in thread append middle of File
by PyrexKidd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |