Since $a is a special var in perl, you shouldn't define own vars of that name. The same applies to $b.
$a is used by the sort function to hold the first of each pair of values to be compared ($b is the second of each pair).
Now you should post your errors also, so that readers can see them, but i guess, perl didn't like you to dereference (@$a) the global variable $a that already existed before you declared my $a.
In reply to Re: Error Sorting Array Reference?
by mantadin
in thread Error Sorting Array Reference?
by arunvelusamy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |