package Verify; sub chkLogs ( $ ) { my $LogFileNm = shift; open ( logHndl, "$LogFileNm" ) or die ("Failed to open $LogFileNm"); while() { # # grep for keyword ERROR or ORA-ERR # push(@errors, grep (/ERROR|ORA-ERR|Fail|Unable/i, $_)); } close(logHndl); if ( $#errors > -1 ) { print "FATAL: ended with the following errors\n"; for( my $idx = 0; $idx < $#errors + 1; $idx ++ ) { print "$errors[$idx]\n"; } exit(10); } } 1;