in reply to How do I extract the number of times a value appears in a hash?
This will place results in the %count and %size hashes, keyed by IP address. If "IPaddr:Size" are the keys, just replace the 'values' with 'keys' in the fragment above.map {if /^(.*):(\d*)$/ {$count{$1}++;$size{$1}+=$2;}} values(%hash);
|
|---|