Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Max value

by Tux (Canon)
on Apr 17, 2019 at 06:13 UTC ( [id://1232699]=note: print w/replies, xml ) Need Help??


in reply to Max value

In the same vane as tybalt89's example. A bit slower but maybe less obscure:

use List::Util qw( max ); my %hashName = (a => 1, b => 2, c => 3, d => 3); my $mx = max values %hashName; say "$_ => $hashName{$_}" for sort grep { $hashName{$_} == $mx } keys +%hashName;

Enjoy, Have FUN! H.Merijn

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (6)
As of 2024-04-20 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found