in reply to Sorting by numbers

Sounds like you are doing just a sort list
What you need is sort { $a <=> $b }list See the perlfunc manpage for sort