while(<>){ if ($. == 1){ print "Now processing $ARGV ...\n" } print if /something/ .. /something else/ } continue { close ARGV if eof }