#!/usr/bin/perl -w { $bucket = 0; $count = 1; open (LOGFILE, ">>log.txt") || die "Can't open file: $!"; while ($infile = glob("/biz/employee/data/*")) { open (INFILE, $infile) || die "Can't open file: $!"; while () { print "$count : "; if ($_ =~ /³400³/) { $bucket++; print "Found Employee $bucket times.\n"; print LOGFILE ("$_\n"); } else { print "\n"; } $count++; } } print "Finished. Found Employee $bucket time in $count files. \n"; }