I like to use hashes for this ... keeps things (mostly) neat while keeping track of data. Be careful, though, hashes can get out of hand if you go nuts with 2+ dimensions
So like, you'd have some hash %count
Each time what you want is hit, you'd increment the appropriate key...
$count{'this_thing'}++
And if what you're coming across is variable, you can use whatever is set in the variable as a key name ... this works well for pattern matches.
my ( $pattern ) = $log_line =~ /(some pattern)/;
$count{$pattern}++;
Make sense?
Of course, with PERL, there's always more than one way to do it
Hope that helped.
Talleyrand