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