# A.pm package A; use strict; use warnings; use Exporter (); BEGIN { our @ISA = 'Exporter'; our @EXPORT = 'foo' } sub foo { print "foo" } # and in the same file A.pm package A::B; use A; sub bar { foo() } # without the BEGIN block above, the use A won't have imported foo into A::B