I know it's more of a "mundane use for Perl", but it was my first truly fuctional Perl script, and using it I was able to hand my boss the list he wanted in a day instead of longer. As far as I'm concerned, that's cool. Simplicus.#!/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 (<INFILE>) { 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"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: Snooping through files
by turnstep (Parson) on Apr 15, 2000 at 21:21 UTC | |
by Simplicus (Monk) on Apr 17, 2000 at 18:42 UTC | |
|
RE: Snooping through files
by Simplicus (Monk) on Apr 14, 2000 at 22:59 UTC |