If you did@sorted=sort{$a <=> $b} @unsorted;
the sort function defaults to doing a textual comparison so 375 would be considered less than 4 since its first character 3 is less than 4.@sorted=sort @unsorted;
In reply to Re: How do I sort a list of numbers?
by vroom
in thread How do I sort a list of numbers?
by vroom
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |