Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Here is what I get:use strict; my %hash = (name1 => {iid1 => '6', iid2 => '3', iid3 => '4'}, name2=> { iid4 => '3', iid6 => '5', iid2 => '2'} ); foreach my $name (keys %hash) { my $count=0; print "Name: $name\n"; foreach my $iid (keys %{$hash{$name}}) { print "$hash{$name}{$iid}\t\t $iid\n"; $count=$hash{$name}{$iid} + $count; } print "$count\t\t TOTAL\n\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting an HoH (Or Something?)
by Limbic~Region (Chancellor) on Mar 26, 2004 at 16:10 UTC | |
|
Re: Sorting an HoH (Or Something?)
by borisz (Canon) on Mar 26, 2004 at 16:14 UTC | |
|
Re: Sorting an HoH (Or Something?)
by Art_XIV (Hermit) on Mar 26, 2004 at 16:33 UTC |