Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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

Comment on Re: sorting array of arrays reference
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2015-11-26 04:09 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (696 votes), past polls