Jun 5, 2015, 3:47 PM
Post #2 of 2
The 'cmp' function does a string comparison, so '50' is sorted before '7'. To do numeric comparison, use <=> . See 'perldoc -q sort' for more examples of ways to sort.
Re: [regex2012] need to print numbers in order
[In reply to]
There's also no need for lc() here, since you can't lowercase a number.