file = "D:/perl/02.log"; open (FILE,$file) || die ("cant open file"); $true=1; ##### look for errors while () { #if (/^Status : ERRORS/) if (/\d{1-9} failed/ ) { $true=0; print "There are build errors\n"; exit 0; } }