http://qs1969.pair.com?node_id=1062335


in reply to Parse a file, replace a particular strings and save new file

You might find Getting Started with Perl helpful. There are references to many resources there.