in reply to Error Sorting Array Reference?

You're using $a, and you shouldn't, because it's a special reserved variable name that you don't predeclare. Use $a and $b only for comparisons.