That's because sort does a lexical sort by default, and you want a numerical sort. Compare the "magic" sort variables $a and $b using the spaceship operator.
perldoc -f sort Reveals the following:
# sort numerically ascending
@articles = sort {$a <=> $b} @files;
# sort numerically descending
@articles = sort {$b <=> $a} @files;
Cheers
Update:Ahah!. Knew it was around here somewhere! Under
Categorized Questions and Answers, in the
sorting subsection (Although it might benefit from being in the array section as well), you'll find
How do I sort a list of numbers?
davis
Is this going out live?
No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist