On Tue, Jun 26, 2001 at 03:04:33PM -0400, Yacketta, Ronald wrote:
> the following should
> 1) suck in all the files in a dor
> 2) split them into 3 arrays (logger files only)
> 3) run a forked egrep on each array of files

I don't understand why you're going to all the trouble of building
three arrays and shelling out to egrep when you can use perl's own
regexes.  Would something like this work?

$lookFor="Test App 
Finished|Fault2-0|ORA-|Bind|SystemError|SystemException|Communication|ORBA|Get Q 
Error";
opendir DIR, "../logs/set1/" or die "Can't open ../logs/set1/: $!";
while (my $file = readdir(DIR)) {
      next unless $file =~ /logger/;

      my $filename = "../logs/set1/$file";
      open FP, $filename;
      while (my $line = <FP>) {
            print "$filename: $line" if $line =~ /$lookFor/;
      }
      close FP;
}

Walt

Reply via email to