All,
Thanks a lot
My requirement is such that if the log contains the string
like "2 failed" or "3 failed"..."<any number except 0>" failed.
I have some other processing to do. So will the below code work.
my $file = "D:/perl/02.log"; open my $inFile, '<', $file or die "cant open $file: $!"; # Look for errors while (<$inFile>) { if (/\d{1-9} failed/) { print "There are build errors (see line $.)\n"; exit 0; } }
In reply to Re^2: Find a pattern
by amvarma
in thread Find a pattern
by amvarma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |