package Foo; # Some kind of just-in-time configuration happens here... sub init { push @INC, '/my/module/dir'; } #### package Bar; use Foo; BEGIN { Foo->init } use Baz; # Resides under /my/module/dir