Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
return -1 means $a goes before $b, return +1 means $b goes before $a, return 0 means they are equal.
The "spaceship operator", <=>, returns -1, 0, or 1 depending on whether the left argument is numerically less than, equal to, or greater than the right argument. Its stringwise counterpart, cmp, returns -1, 0, or 1 depending on whether the left argument is stringwise less than, equal to, or greater than the right argument.
To learn more about these operators, please read perlop.
In reply to Re: How do I write my own sorting routine?
by nardo
|
|