In my ideal world, I'd have /(lib path) in the lib already, and then use dirAAA::ModuleA and dirBBB::ModuleB.
Assuming, however, that you're really using "use ModuleA" to get at ModuleA, you can use %INC:
my $libpath; BEGIN { ($libpath = $INC{'ModuleA.pm'}) =~ s:/dirAAA/.*:dirBBB:; } use lib $libpath;
In reply to Re: use lib between modules
by Tanktalus
in thread use lib between modules
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |