Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: Numeric sorting WITHOUT <=>

by AnomalousMonk (Canon)
on Oct 10, 2012 at 13:08 UTC ( #998225=note: print w/replies, xml ) Need Help??


in reply to Re^2: Numeric sorting WITHOUT <=>
in thread Numeric sorting WITHOUT <=>

my ($min) = keys(%jetsons); This is the number of keys in %jetsons.

Actually, it's a randomly (insofar as the hashing algorithm is random) chosen key from the hash. The assignment is in list context and seeds the min/max finder loop that follows.

>perl -wMstrict -le "my %jetsons = qw(aa 1 bb 2 cc 3 dd 4 ee 5); my ($min) = keys %jetsons; print $min; " cc

Update: ikegami's code works. (Never doubt a Pope.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://998225]
help
Chatterbox?
[stevieb]: can anyone recommend a good IDE for C programming that has *proper* vim plugin support? I've tried Eclipse, Netbeans etc and just can't get anything to work properly on Linux. I'm open to paying, but not on some monthly/yearly plan (just a one-off cost)
[stevieb]: I'd go with CLion as it's very similar to what I use already (intelliJ for Perl, Pycharm for Python), but it's a recurring fee every year

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-01-18 19:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (163 votes). Check out past polls.