lackita has asked for the wisdom of the Perl Monks concerning the following question:
Hey, monks. I've got two module trees which are nearly identical, and I have to run the same command once with each of these trees. The best method I can come up with is to combine a local $ENV{PERL5LIB} with system:
#/usr/bin/perl for my $tree ("a","b") { local $ENV{PERL5LIB} = $tree; system("perl -e 'use Foo;Foo::Bar()'"); }
Is there a way to accomplish this without having to start a subprocess?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Changing Module Tree
by wind (Priest) on Apr 05, 2011 at 20:28 UTC | |
by lackita (Sexton) on Apr 05, 2011 at 21:09 UTC | |
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 |