perl -i.bak -pe '$_="# $_" if($.>=10 and $.<=20)' myscript.pl
You can omit mention of $. and the comparators if you want.
perl -i.bak -pe '$_="# $_" if 10 .. 20;' myscript.pl
Cheers,
JohnGG
In reply to Re^2: Shortcut for inserting comments
by johngg
in thread Shortcut for inserting comments
by ramthen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |