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