for (sort { $HoH{$b}{head_count} <=> $HoH{$a}{head_count} } keys %HoH) { print "$_ House Type: $HoH{$_}{house_type} Head Count: $HoH{$_}{head_count}\n"; }