Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Max value

by rsFalse (Hermit)
on Apr 17, 2019 at 14:59 UTC ( #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
Node Status?
node history
Node Type: note [id://1232718]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2020-09-29 14:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (146 votes). Check out past polls.

    Notices?