I am using:
@sorted = sort { $a cmp $b } @unsorted;
To sort table elements alphabetically, but when I sort things like:
z
zzz
aaaa
bbb
I become:
aaaa
bbb
z
zzz
Is there a way to make string length a higher priority than the sequence of letters in alphabet, and get result like:
z
bbb
zzz
aaaa
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.