Here, @a = sort {$a <=> $b or length($a) <=> length($b)} @a; 15 and '15–21' both become 15 in numeric context. When numeric values are equal, length of string is taken as a tiebreaker.
After Compline,
Zaxo
In reply to Re: Problem sorting strings numerically
by Zaxo
in thread Problem sorting strings numerically
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |