http://qs321.pair.com?node_id=703013

n3toy: I have a hash where the values are all numerical. Is there a quick way to sum all the hash values?

GrandFather: my $total; $total += $_ for values %hash;

Lawliet: $sum += $hash{$_} foreach keys %hash;

tye: my $count= map( (1)x$_, values %hash );

Lawliet forgot there was a values keyword!

davido: use List::Util qw(sum); my $total = sum( values %hash );