use warnings; use strict; my (%HoH) = ( "Smith" => { "house_type" => 'colonial', "head_count" => '5', }, "Jones" => { "house_type" => 'cape', "head_count" => '3', }, ); for (reverse sort { $HoH{$a}{head_count} <=> $HoH{$b}{head_count} } ke +ys %HoH) { print "$_ House Type: $HoH{$_}{house_type} Head Count: $HoH{$_}{he +ad_count}\n"; } __END__ Smith House Type: colonial Head Count: 5 Jones House Type: cape Head Count: 3
In reply to Re: Sort Hash of Hash numerically
by toolic
in thread Sort Hash of Hash numerically
by PerlUsr173
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |