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

Re: sorting numerically and alphabetically

by Corion (Patriarch)
on Jun 28, 2006 at 12:34 UTC ( [id://557994]=note: print w/replies, xml ) Need Help??


in reply to sorting numerically and alphabetically

For your limited example, sort already does exactly what you want. I guess though that what you want isn't what sort does for the following example:

firstcase_1 secondcase_4 secondcase_11 secondcase_012

What you want is called "natural sorting", and tye has a nice node on it - our categorized Questions and Answers also has How do I do a natural sort on an array?.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-03-29 02:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found