I'm used to using sed to change a range of lines in a file. I've found that I like to use Perl better, but I haven't been able to figure out a way to specify a range of lines to change.
In sed I can do:
sed -i '1,10 s/before/after' filename
and that will change the text only on lines 1 - 10 inclusive.
Is there a way to do the same thing in Perl? To change all lines, I'd just do:
perl -pe 's!before!after!' -i filename
Thanks....
PETERV
Syracuse, NY &
Boston, MA
In sed I can do:
sed -i '1,10 s/before/after' filename
and that will change the text only on lines 1 - 10 inclusive.
Is there a way to do the same thing in Perl? To change all lines, I'd just do:
perl -pe 's!before!after!' -i filename
Thanks....
PETERV
Syracuse, NY &
Boston, MA