Rick wrote:
trying out getting lasrgest key(by value)

<snip>

my %files=%{{"one" =>"1", "thiry" =>"30", "four" =>"4", "never" =>"997", "forever" =>"100001", "five" =>"5"}};

Any special reason why you say

    my %files = %{{ ... }};

instead of simply

    my %files = ( ... );

?

While this suggestion is inefficient, it takes less typing compared to other postings:

    my $max = ( sort { $files{$b} <=> $files{$a} } keys %files )[0];

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to