use strict; use warnings; { package B; our $foo = 3; } package main; print "foo is >$foo<\n"; __END__ Global symbol "$foo" requires explicit package name at - line 10. Execution of - aborted due to compilation errors.