Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: sorting array of arrays reference

by salva (Abbot)
on Oct 25, 2013 at 17:38 UTC ( #1059722=note: print w/replies, xml ) Need Help??

in reply to sorting array of arrays reference

Use Sort::Key::Top which implements the Selection Algorithm:
use Sort::Key::Top qw(rikeytopsort); my @sorted = rikeytopsort { $_->[2] } 3 => @masterArray; # rikeytopsort means... # r => reverse (descending) order # i => the key is an integer # key => use a key extraction block # top => get the top n elements # sort => sorted

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1059722]
[Corion]: marto: Oh, I'm jealous. I'm going to see DM in Frankfurt, but it's a stadium full of people, so, rather a big thing where you mostly get to see the band on screens ;)
[marto]: yes, the last time I saw them was in Berlin a few years ago, at the old Olympic stadium
[marto]: After Sunday I don't think I'll go see them again :)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-03-24 11:34 GMT
Find Nodes?
    Voting Booth?
    Should Pluto Get Its Planethood Back?

    Results (301 votes). Check out past polls.