Thanks all for the help I'm havng a go wrighting it at the moment Pat
On 9/13/07, Moon, John <[EMAIL PROTECTED]> wrote: > > From: John W. Krahn [mailto:[EMAIL PROTECTED] > Sent: Thursday, September 13, 2007 2:01 PM > To: Perl beginners > Subject: Re: adding data to a file before it gets regexed > > Moon, John wrote: > > From: John W. Krahn [mailto:[EMAIL PROTECTED] > >> > >> Here is another way to do it: > >> > >> my $logs_total = () = <*log>; > >> my $processed = @ARGV = <access_sun83*log>; > >> my %logs; > >> $logs{ $ARGV }++ while <>; > >> > >> print "There are $logs_total logs HERE\n"; > >> print "I processed $processed logs\n"; > >> for my $filenm ( sort keys %logs ) { > >> print "There are $logs{$filenm} items in $filenm\n"; > >> } > > > > John > > [>>] > > Look like it gave someone some ideas... ;-) > > > > Since we're "going there" you _should_ also check on *close* (on an > > output file) - may save you a lot of time... > > > > As for slurping in a "log" file ... some can be *very* large... > > Nowhere in the code that I posted are the "log" files being "slurped > in", only > one line is being read at a time. > > > > John > > [>>] Please excuse my error... > > jwm > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > http://learn.perl.org/ > > >