Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Max value

by rsFalse (Chaplain)
on Apr 17, 2019 at 14:59 UTC ( [id://1232718]=note: print w/replies, xml ) Need Help??


in reply to Re: Max value
in thread Max value

Another one variant:
use strict; use warnings; my %hash_name = ( a => 1, b => 2, c => 3, d => 3 ); my %keys_of_max; my $key_of_max; my $numeric_cmp_result; $numeric_cmp_result = defined $key_of_max ? ( eval join '<=>', map { $hash_name{ $_ } } $_, $key_of_max +) : 1 xor $numeric_cmp_result > 0 and %keys_of_max = ( $key_of_max = $_ +=> 1 ) xor ( $numeric_cmp_result or $keys_of_max{ $_ } = 1 ) for keys %hash_name; print sort keys %keys_of_max;
OUTPUT:
Useless use of logical xor in void context at perlmonks_Max_Value.pl l +ine 26. cd

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-25 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found