The <=> numeric comparison automatically numerifys to a decimal number before the comparison:
>perl -wMstrict -le "my @l = qw(10 010 0010 8 08 008 9 09 009 1 01 001); @l = sort { $a <=> $b } @l; print qq{@l}; " 1 01 001 8 08 008 9 09 009 10 010 0010
In reply to Re^2: How do I sort a CSV file on multiple columns?
by AnomalousMonk
in thread How do I sort a CSV file on multiple columns?
by mmittiga17
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |