Simply I tried this and seems to be working:-
#!/usr/bin/perl use strict; use warnings; my ($sorthash); $sorthash->{'10'}->{'20'}= '1'; $sorthash->{'40'}->{'50'}= '4'; $sorthash->{'20'}->{'30'}= '2'; foreach my $diff (sort {$sorthash->{$b} <=> $sorthash->{$a}} keys %{$s +orthash}) { foreach my $rptNo (keys %{$sorthash->{$diff}}) { print "$diff--- $rptNo\n"; } }
By: Kuldip Singh Behal
In reply to Re^2: hash of hashes sort second level keys
by Anonymous Monk
in thread hash of hashes sort second level keys
by aeaton1843
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |