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


in reply to Re: doing a search and replace on a large file
in thread doing a search and replace on a large file

Or, if you want to overwrite the file use the '-i' cmdline option for in-place editting:
perl -pi -e's/pattern here//g' file
Update: reread question, you don't want to overwrite the file, so you don't want this.