Actually you can just lose the substr. It isn't gaining you anything. Perl will convert the strings to numbers and just Do The Right Thing.
@values = sort { $a <=> $b } @values;
Update: broquaint reminds me that this will generate warnings under "use warnings". It will still give the right answer tho' :)
--"The first rule of Perl club is you do not talk about
Perl club."
-- Chip Salzenberg
In reply to Re: substr sort ??
by davorg
in thread substr sort ??
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |