my @keys = sort(keys(%hash)); for(my $i=$#keys; 0 <= $i; $i--) { print $hash{$keys[$i]}; }