$ perl -e '@names = (["Nan Tregar"], ["Sam Tregar"]); @names = sort { +$a->[0] <=> $b->[0] } @names;' Sort subroutine didn't return a numeric value at -e line 1.
Note that you have to work a little. Just a straight { $a <=> $b } gets optimized into something that doesn't do the NaN conversion.
-sam
In reply to Re^2: Dangerous Names
by samtregar
in thread Dangerous Names
by samtregar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |