Make sort’s warnings dependent on the right hints
sort’s warnings about uninitialized (or non-numeric) values returned
from comparison routines are emitted in the scope of the compar-
ison routine, not the sort function itself. So, not only does
‘use warnings; sort...’ not always warn, but the line numbers can be
off, too:
$ ./perl -Ilib -e '()=sort flobbp 1,2;' -e'use warnings;sub flobbp{"foo"}'
Argument "foo" isn't numeric in sort at -e line 2.
The solution is to restore PL_curcop to its previous value before get-
ting a number out of the comparison routine’s return value.