Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: how to sort

by glenn (Scribe)
on Sep 13, 2013 at 14:01 UTC ( #1053943=note: print w/replies, xml ) Need Help??


in reply to how to sort

Have you considered using AoA? http://www.sitepoint.com/forums/showthread.php?659680-Perl-Sort-Array-of-Arrays&p=4508119&viewfull=1#post4508119
my @AoA = ( ['a', '2003-11-09', 'b'], ['c', '2003-11-01', 'd'], ['e', '2002-11-01', 'f'], ['g', '2003-10-01', 'h'], ['g', '2002-10-01', 'h'], ); my @new_arr = sort {$a->[1] cmp $b->[1]} @AoA; for (@new_arr) { say "@$_"; } --output:-- g 2002-10-01 h e 2002-11-01 f g 2003-10-01 h c 2003-11-01 d a 2003-11-09 b

Log In?
Username:
Password:

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

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












    Results (50 votes). Check out past polls.

    Notices?