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) };
In reply to Re: Sort Values in Hash, While Tracking Keys.
by hipowls
in thread Sort Values in Hash, While Tracking Keys.
by BioNrd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |