I believe this is how you would normally sort a hash by value:
foreach my $key (sort { $hash{$a} <=> $hash{$b} } (keys %hash) ) {
print "$key=>$hash{$key}";
}
This would print out the values smallest to largest.
Now, what if I have a hash like this:
$hash{$somekey}{$somekey2}{$thirdkey}
How could I sort by values and get all the keys as well?
I would just create a new hash: