in reply to Error Sorting Array Reference?

The error message says it all. Look at perldoc -f sort (I quote):
If you're using strict, you must not declare $a and $b as lexicals. They are package globals.
etc..