for my $k (sort { $h{$a} cmp $h{$b} } keys %h) { say "$k => $h{$k}"; }