in reply to Re: Questions about Grep
in thread Questions about Grep

Don't know if this is any more efficient, but it's a few less keystrokes:
use strict; open my $fh, "file.txt" or die "Error opening file.txt: $!"; print grep /pattern/, <$fh>;