I need to get the count of unique IP addresses , count of unique URLs and...
For counting unique things, it's usually more appropriate to use the item of interest (such as the URLs) as the hash's key...
After having put all items in the hash, the number of keys indicates the number of unique items.
my @things = qw(foo bar foo baz baz); my %hash; $hash{$_}++ for @things; print scalar keys %hash; # 3
In reply to Re: Parsing tomcat access log
by Anonyrnous Monk
in thread Parsing tomcat access log
by snra_perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |