All you need is really a one liner
perl -pi -e 's/line2/changed_line2/'
see perldoc -q insert for more examples and the equivalent expanded code. see also the note on one liners in windows if you are in windows
HTH
-T
use perl; use strict;
In reply to Re: Modifying lines of text
by thens
in thread Modifying lines of text
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |