C:\>perl -MO=Deparse -wMstrict -e "{package foo; *::x=\$a} $x++" Variable "$x" is not imported at -e line 1. Global symbol "$x" requires explicit package name (did you forget to declare "my $x"?) at -e line 1. -e had compilation errors. BEGIN { $^W = 1; } use strict; { package foo; *main::x = \$a; } $main::x++;