![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
a proper sortby ministry (Scribe) |
on Mar 04, 2005 at 14:31 UTC ( #436578=perlquestion: print w/replies, xml ) | Need Help?? |
ministry has asked for the wisdom of the Perl Monks concerning the following question:
I have a list containing various names, some with a numeric suffix and some without. For example my list would contain (file1...file20), (server1...server20), & (ps,df,find,etc...). I would like to sort this list first by an alpha comparison, and secondly by a numeric value comparison. Here's what I have so far:
This is as close as I have come to getting what I need, unfortunately this sort will return the elements of my list that do not contain numeric characters at the top of the list, as opposed to the required method of an alpha comparison first. Regards, Ev
Back to
Seekers of Perl Wisdom
|
|