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

Re^2: natural sort on array of arrays

by duelafn (Vicar)
on May 10, 2016 at 17:07 UTC ( #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
Node Status?
node history
Node Type: note [id://1162649]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2021-03-01 16:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (13 votes). Check out past polls.

    Notices?