Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Advanced Bubble Sort (Natural Sort)

by Corion (Patriarch)
on Oct 14, 2016 at 09:25 UTC ( [id://1174001]=note: print w/replies, xml ) Need Help??


in reply to Advanced Bubble Sort

If your input data isn't immediately amenable to use with sort, the likely best approach is to extract the search criteria, transform them into strings, sort on these, and then transform the result back to the strings you want.

This approach is interesting if you want 11_foo to sort after 1_foo but both before 2_zap.

There are many nodes on Natural Sort:

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-24 03:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found