Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: printing largest hash value

by demerphq (Chancellor)
on Feb 22, 2005 at 09:06 UTC ( #433288=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %hash=();
    my $highest;
    my @highest=grep {defined $highest ? $hash{$_}==$highest : (($highest=
    +$hash{$_}),1) } 
                sort { $hash{$b} <=> $hash{$a} || $a cmp $b } 
                keys %hash;
    
  2. or download this
    my %hash=();
    my %rev;
    ...
      $highest=$hash{$_} if $highest < $hash{$_};
    }
    print sort keys %{$rev{$highest}};
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://433288]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2022-01-29 14:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?