in reply to Get hash value with the lowest key
#!perl use strict; use warnings; my $href = { '6' => '154', '4' => '152', '1' => '80', '3' => '151', '8 +' => '150' }; my $key = (sort {$a <=> $b} keys %$href)[0]; my $value = $href->{$key}; print "$key => $value\n"; __END__ 1 => 80
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Get hash value with the lowest key
by kiat (Vicar) on Jun 14, 2004 at 10:13 UTC |