Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Sorting a subsetby flounder99 (Friar) |
on Dec 12, 2003 at 20:04 UTC ( [id://314397]=note: print w/replies, xml ) | Need Help?? |
In your example the second for loop will sort based on the numerical value of array elements with the first character chopped off. If that is what you want then something like this will work:
If you want to sort asciibeticly just use sort. You don't need to do the substr since the first letter will be 'A' already. A substr will be faster than doing a regex but if you want to make it short you could also write it like this.
-- flounder
In Section
Seekers of Perl Wisdom
|
|