http://www.perlmonks.org?node_id=985963


in reply to Re: Delete specific lines from txt file.
in thread Delete specific lines from txt file.

This can be directed to a file.
Just don't redirect it to the original file name. The first thing the OS would do is to truncate the original file, leaving no data for your text file to work with.

--MidLifeXis