Sort multidimensional hash by values and print the highest
问题 I have a stored multidimensional hash ( %info ) with following structure: $info{$os}{$id}=$length; foreach $os (keys %info){ foreach $id (keys %{$info{$os}}){ print "$os $id => " . $info{$os}{$id} ."\n" if (keys %info > 100); } } With this, I can read the hash and print only those $os with more than 100 occurrences, but now I would like to print only the $id with highest $length (i.e., values). So I would like to sort the hash by values and print only $os and $id with highest value. Any help?