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