in reply to remove and insert

Well, I guess the first thing you would want to do is open your original file (lets call this your INFILE).

Then you might want to create a new file to write your result into - OUTFILE, perhaps?

Then you'd probably want to iterate through your INFILE line by line until you found the line that matches. If the line didn't match, you'd simply print it to your OUTFILE, but if it did match, then you'd instead print the replacement text to your OUTFILE.

There are a few ways you could do the iteration. You might read the whole file into an array, and then use a foreach loop, or you might read it one line at a time with a while loop.

As far as finding the right line goes, you'll almost certainly need to use a regular expression

And of course, if you have a look at the doco for perlrun, you'll find that Perl has a nifty in-place file editing feature (-i), which allows you to do all of the above quite easily from the command line.

So... there's a basic outline of what is needed and some links to help you. Why don't you now have a go a writing it, and then come back and ask if you get stuck with any particular part (don't forget to show us the code that does/doesn't work).

Hope this helps,
Darren :)