$ perl -le ' BEGIN { my $x = 1; } print defined $x ? "defined" : "undefined";' undefined #### $ perl -Mstrict -le ' BEGIN { my $x = 1; } print $x;' Global symbol "$x" requires explicit package name at -e line 2. Execution of -e aborted due to compilation errors.