in reply to Grepping the filehandler
print $1 if <$a> =~ m/(error.*)/; # Nothing printed though the files h +as the line containing error key word. [download]
print map /(error.*\n)/, <$a>; [download]