There's more than one way to do things | |
PerlMonks |
Re: Sorting an array IIby robartes (Priest) |
on Mar 03, 2003 at 09:41 UTC ( [id://239982]=note: print w/replies, xml ) | Need Help?? |
Um, an array does not have any labels. A hash has keys, which is what you're using in your examples. If you want to sort a hash by the keys, use your first example (if the keys are numerical). If you want to sort the values, alphanumerically, use straight sort (which uses the cmp operator, which sorts strings in ascending ASCII order (thus roughly alphabetic) ):
CU
In Section
Seekers of Perl Wisdom
|
|