Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: natural sort on array of arrays

by duelafn (Parson)
on May 10, 2016 at 17:07 UTC ( [id://1162649]=note: print w/replies, xml ) Need Help??


in reply to Re: natural sort on array of arrays
in thread natural sort on array of arrays

The test data the OP has doesn't reveal the difficulty well. A better test (I've gotten rid of the extra array parts to focus on the sorting) is:

use 5.010; my @items = qw/ A1a1 A1a12 A1a2 A10a1 A12a1 /; say join " ", sort { $a <=> $b } @items; # prints: A1a1 A1a12 A1a2 A10a1 A12a1 # ^- :( -^

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://1162649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (3)
As of 2024-04-19 01:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found