in reply to max key-value pair in a hash
#! perl -slw use strict; use List::Util qw[ max ]; my %some_hash = ( sunny => .63, cloudy => .17, rainy => .2 ); my $max = max values %some_hash; print +{ reverse %some_hash }->{ $max }, ' :: ', $max; __END__ C:\test>539366 sunny :: 0.63
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: max key-value pair in a hash
by kettle (Beadle) on Mar 27, 2006 at 06:26 UTC | |
by BrowserUk (Patriarch) on Mar 27, 2006 at 06:39 UTC |