in reply to Tricky sorting of HOH.
You might also find the following useful:use strict; use warnings; my %hash_of_hashes=( 'A'=>{'param'=>9, 'number'=>1}, 'B'=>{'param'=>4, 'number'=>1}, 'C'=>{'param'=>5, 'number'=>1}, 'D'=>{'param'=>12, 'number'=>1}, ); for my $key (sort {$hash_of_hashes{$a}{param} <=> $hash_of_hashes{$b}{ +param}} keys %hash_of_hashes) { print "$key\n"; }
|
|---|