my(@Log) = @_; my $info = join("", grep(/^$FAILURE_SEARCH /, @Log)); #greps in log for FAILURE: and sets $info equal to the line containing FAILURE: if found chomp $info; $info =~s/$FAILURE_SEARCH //ie; if($info ne ""){ print "INFO: $info \n"; print "This occurred on line $.\n"; } return $info;