in reply to Re: Changing Module Tree
in thread Changing Module Tree
Alright, so that solves the problem of a single module, but what if Foo uses several other modules?
Also, this would work in the limited example, but I also have a third module path that will need to be restored afterwards:
#/usr/bin/perl use Foo; Foo::Prep(); for my $tree ("a","b") { local $ENV{PERL5LIB} = $tree; delete $INC{'Foo.pm'}; require Foo; Foo::Bar(); } Foo::Cleanup();
It seems cumbersome to have to stick an additional delete/require after the loop.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Changing Module Tree
by wind (Priest) on Apr 05, 2011 at 21:25 UTC | |
by lackita (Sexton) on Apr 06, 2011 at 14:21 UTC | |
by Anonymous Monk on Apr 06, 2011 at 14:44 UTC | |
by wind (Priest) on Apr 06, 2011 at 22:50 UTC |