in reply to Scanning a file for all ERRORs, then sending only one page (break out?)
You should consider checking that the opens and the system call in fact worked too. Probably the best solution would be to keep a count of all errors, and all files that contained errors, and then just page the long suffering Mike with a message like "$errortotal errors found in $badfiletotal files".foreach my $logrecord (@errorcheck) { my $errorcount; open (LOGFILE, $logrecord); while (<LOGFILE>) { if(/$error/) { $errorcount++; } } print "$logrecord: $errorcount\n"; if($errorcount != 0) { system ('page Mike "An error was encountered processing file $logr +ecord. Check the HelpDeskLog\ERRORS dir for more information."'); #last; here if you don't want to bother Mike more than once }
--
I'd like to be able to assign to an luser
|
|---|