use strict; package foo; our $x; # Declare $x as an abbreviation for $foo::x $x = 23; package bar; print $x; # Still refers to $foo::x even # though we're now in package 'bar' #### # This is test.pl use strict; our $foo = "Hello!\n"; use Bar; Bar->test(); #### # This is Bar.pm use strict; our $foo; package Bar; sub test { print $foo; } 1;