print "$_\t$hash{$_}\n" for reverse sort { $a <=> $b } keys %hash; # or simply print "$_\t$hash{$_}\n" for sort { $b <=> $a } keys %hash;