scratchpad
n3toy
[n3toy]: I have a hash where the values are all numerical. Is there a quick way to sum all the hash values?
<p>
[GrandFather]: my $total; $total += $_ for values %hash;
<p>
[Lawliet]: $sum += $hash{$_} foreach keys %hash;
<p>
[tye]: my $count= map( (1)x$_, values %hash );
<p>
[Lawliet] forgot there was a values keyword!
<p>
[davido]: use List::Util qw(sum); my $total = sum( values %hash );
<p>