roboticus answered the immediate question, but note that this is why you should avoid using $a and $b a general purpose variables: they are magical and should really only be used inside sort.
Note too that using sort without a {...} bit is like sort {$a cmp $b}. That is, sort's default is to do a string sort.
In reply to Re: $a <=> $b
by GrandFather
in thread $a <=> $b
by truthseeker66
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |