Hash::Tally - Compute the tallies of hash values
use Hash::Tally qw( tally ); my $data = { Shipping => { English => { Canada => 8, 'United States' => 13, }, French => { Canada => 26, 'United States' => 3, }, }, Receiving => { English => 56, French => { Canada => 12, 'United States' => 5, }, }, }; tally( $data ); # $data now has the following value: $data = { Shipping => { English => { Canada => 8, 'United States' => 13, tally => 21, }, French => { Canada => 26, 'United States' => 3, tally => 29, }, tally => { Canada => 34, 'United States' => 16, tally => 50, }, }, Receiving => { English => 56, French => { Canada => 12, 'United States' => 5, tally => 17, }, tally => 73, }, tally => { English => 77, French => { Canada => 38, 'United States' => 8, tally => 46, }, tally => 123, }, };
A method designed to calculate the tallies of hashes. It was originally designed for reporting and statistical purposes.
Adam Paynter <adapay@cpan.org>
Copyright 2006 by Adam Paynter
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Hash::Tally, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Hash::Tally
CPAN shell
perl -MCPAN -e shell install Hash::Tally
For more information on module installation, please visit the detailed CPAN module installation guide.