for my $d ( sort { $hash{$a}{desc} cmp $hash{$b}{desc} } keys %hash ) { my $desc = $hash{desc}{$d}; ... }