in reply to Error: Can't use global $^W in "my"

Here's what perl sees with the -w switch on the shebang:

$ perl -MO=Deparse #!perl -w ^D BEGIN { $^W = 1; } - syntax OK

use warnings; instead of -w will stop the warnings since you're using a recent perl.