in reply to my $a outside sort block incompatibility

Even more documentation telling you to avoid this scenario from sort:
If you're using strict, you must not declare $a and $b as lexicals. They are package globals.
etc.
  • Comment on Re: my $a outside sort block incompatibility