18:05 >perl -Mstrict -wE "package Foo; sub foo { say $x; } package main; $x = 42; Foo::foo;" Global symbol "$x" requires explicit package name (did you forget to declare "my $x"?) at -e line 1. Global symbol "$x" requires explicit package name (did you forget to declare "my $x"?) at -e line 1. Bareword "Foo::foo" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. 18:06 >perl -Mstrict -wE "use vars qw( $x ); package Foo; sub foo { say $x; } package main; $x = 42; Foo::foo;" Global symbol "$x" requires explicit package name (did you forget to declare "my $x"?) at -e line 1. Bareword "Foo::foo" not allowed while "strict subs" in use at -e line 1. Execution of -e aborted due to compilation errors. 18:06 >perl -Mstrict -wE "use vars qw( $x ); package Foo; sub foo { say $::x; } package main; $x = 42; Foo::foo;" 42 18:06 >perl -Mstrict -wE "package Foo; sub foo { say $::x; } package main; $x = 42; Foo::foo;" 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. Execution of -e aborted due to compilation errors. 18:06 >