#!/usr/bin/perl -- use strict; use warnings; use diagnostics; my $foo = 1; {# a new scope my $bar = 2; }# end of new scope my $baz = $bar; # $bar doesn't exist in this scope __END__ Global symbol "$bar" requires explicit package name at test.pl line 12. Execution of test.pl aborted due to compilation errors (#1) (F) You've said "use strict vars", which indicates that all variables must either be lexically scoped (using "my"), declared beforehand using "our", or explicitly qualified to say which package the global variable is in (using "::"). Uncaught exception from user code: Global symbol "$bar" requires explicit package name at test.pl line 12. Execution of test.pl aborted due to compilation errors. at test.pl line 13 #### my $foo = 1; my $bar; {# a new scope $bar = 2; }# end of new scope my $baz = $bar;