for my $k (sort { $hash{$a} <=> $hash{$b} } keys %hash) { print "$k: $hash{$k}\n"; }