It's really the regular hash counting problem:
By not checking for truth of $_->{$key}, you get also get a count of missing entries in $outputhash{""} and you don't miss Department Zero if it's spelled 0.sub somefunction { my ($hash, $key) = @_; my %outputhash; $outputhash{$_->{$key}}++ for values %$hash; %outputhash; }
After Compline,
Zaxo
In reply to Re: Simulating a summary of a hash
by Zaxo
in thread Simulating a summary of a hash
by monarch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |