in reply to string occurences
-----------------------open F,"<squid_logfile" or die "$!"; my %counts; #tie the file to a DB hash or something similar if memory is a concern while(<F>){ my $url=.... #extract url from a line of data and put it in $url $counts{$url}=0 if !defined $counts{$url}; $counts{$url}++; } close F; #do something with %counts to produce your report.
added later
Since I always run w/ warnings and strict on I can't get away w/ the "an undefined hash value is treated as 0 numericly" trick.
Also, because of the way I am using the hash, the "defined" check is good enough, because there will not be a hash entry that is undef.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: string occurences
by MeowChow (Vicar) on Jun 12, 2001 at 21:20 UTC | |
|