![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
sorting numbered wordsby Anonymous Monk |
on Dec 18, 2006 at 13:43 UTC ( [id://590431]=perlquestion: print w/replies, xml ) | Need Help?? |
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Is there a 'good' way to sort a list that looks like this:
text1 text2 text3 text10 text11 so that it ends up in that order? Using the normal sort it puts the 10 and 11 before the 2 (as expected). The only thing i've been able to think of is to use a regex to break up anything that matches that pattern, drop the pieces in a hash then use || to sort on 2 values. This seems like a bit of a hack to me though.
Back to
Seekers of Perl Wisdom
|
|