print grep /error/, <$f>; #### open my $f, '<', 'file' or die $!;