Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I'm installing modules on a shared web server. I've read the tutorials in the tutorials section on installing modules. Both recommend installing modules beneath your home directory (in a shared environment) like so:
$ perl Makefile.PL PREFIX=~/lib LIB=~/lib
So say I want to install module XYZ that has dependencies. Sure I could install them into my ~/lib directory, but I could be installing modules all day at that rate, and eating up space too. (I've been prompted to install libwww-perl before when I know it exists... just not in my home directory) My other option is to leave out LIB all together and let perl look in the default locations. The modules could be there, but they may not.

Is it possible to provide multiple paths to LIB? Say I want the Makefile to look in my ~/lib directory first, then if it's not found to look in the standard locations. then of course if the dependant module exists in neither path I simply install it in my ~/lib directory.

Thanks

Replies are listed 'Best First'.
Re: Install Modules using multiple LIB paths
by Tanktalus (Canon) on Oct 05, 2005 at 21:21 UTC

    By default, perl will still use the @INC that is compiled into it. And it will still use the environment variable PERL5LIB, if it's set. (If not, it'll try PERLLIB as well.) So, if the dependant modules are already in the standard location, Makefile.PL should be able to find them and be satisfied. If you've installed to a second local directory, don't do that, but you can set PERL5LIB for that. If someone came up with the bright idea of a shared local directory (i.e., one person installs for a group), but you need more on top of that, PERL5LIB can help there, too.

    Even if it's already in ~/lib, you may need to set PERL5LIB to include that path - I can't recall offhand.