That way, we can help you understand how to do it better.
Update: I did not notice the second level of hash in the OP - see AnomalousMonk's (++) more correct answer below, for 2 levels of hashes.my $total = 0; for my $v ( values %Your_Hash_name ){ $total += $v; } # Can also be written as: # $total += $_ for values %Your_Hash_Name; print "Total: $total\n";
When in doubt, mumble; when in trouble, delegate; when in charge, ponder. -- James H. Boren
In reply to Re: Hashes - perl
by NetWallah
in thread Hashes - perl
by Perlseeker_1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |