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