Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Sorting Alphanumeric Arrays

by Joost (Canon)
on Jun 13, 2005 at 20:05 UTC ( [id://466272]=note: print w/replies, xml ) Need Help??


in reply to Sorting Alphanumeric Arrays

use Sort::Versions
#!/usr/local/bin/perl -w use strict; use Sort::Versions; my @old = ("99B","99","99A","100A","100","101","88"); print "$_\n" for sort { versioncmp($a,$b) } @old;
output:
88 99 99A 99B 100 100A 101

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 13:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found