You should not be using $a and $b however, as they are "special" variables used by sort
Doesn't matter. sort localizes $a and $b.
$a = 1; print((sort { $b cmp $a } qw( a b c z y x )), $/); print($a, $/); # Prints "1"
In reply to Re^2: Replace $a with $b if $a ne $b
by ikegami
in thread Replace $a with $b if $a ne $b
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |