You're doing an alphabetical sort. Sort numerically using
@sorted = sort { $a <=> $b } @unsorted;
See the perlop manpage for details.
Cheers, Flo
In reply to Re: Sorting sorts 13 as less than 2
by rafl
in thread Sorting sorts 13 as less than 2
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |