use strict; use warnings; my %some_hash = ( sunny => .63, cloudy => .17, rainy => .2 ); my @key_list = keys %some_hash; my $max_key = pop @key_list; foreach (@key_list) { $max_key = $_ if $some_hash{$_} > $some_hash{$max_key}; } print $max_key." :: ".$some_hash{$max_key}."\n";