in reply to How can I find and delete a line from a file?

You could do it on the fly:
local @ARGV = ("input.file"); while(<>) { s/pattern//; # remove line matching pattern print; last if eof; }
now you're done in one pass, but you need to include -i.bak in your perl command line.

Originally posted as a Categorized Answer.