in reply to How can I add the values of a hash?
Your question could be clarified, but I'm assuming you have a hash that has numerical values, and you want to add all the values...
my $total = 0; foreach(values %hash) { $total += $_; } print "$total\n";
|
|---|