in reply to Re: quick "open->close" file
in thread quick "open->close" file

Minor correction: Replace "get_lines" with "getlines".
use IO::File;
my $line = -f $file and grep { ... } IO::File->new($file)->getlines;