Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: natural sort on array of arrays

by salva (Canon)
on May 11, 2016 at 06:46 UTC ( [id://1162698]=note: print w/replies, xml ) Need Help??


in reply to natural sort on array of arrays

useSort::Key::Natural qw(natkeysort);
my @sorted = natkeysort { $_->[0] } @matrix;

Replies are listed 'Best First'.
Re^2: natural sort on array of arrays
by duelafn (Parson) on May 11, 2016 at 15:08 UTC

    Excellent! I love Sort::Key, but never noticed it has a natural sort included. Took me a moment to figure out what it was doing in its key maker though — it has a packing algorithm which allows it to sort numbers of arbitrary size (unlike most of the techniques in this thread).

    Good Day,
        Dean

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 05:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found