in reply to Sort Values in Hash, While Tracking Keys.

my ( $key, $value ) = @{ # 5. dereference anonymous hash + ( sort { $a->[1] <=> $b->[1] } # 3. sort numerically by value map { [ $_ => $hash{$_} ] } # 2. convert to anonymous array keys %hash # 1. each key )[-1] # 4. get last (highest value) };