How do I use a dependency on a Perl module installed in a non-standard location?

Posted by Kinopiko on Stack Overflow See other posts from Stack Overflow or by Kinopiko
Published on 2010-06-18T02:36:02Z Indexed on 2010/06/18 3:13 UTC
Read the original article Hit count: 396

Filed under:
|

I need to install two Perl modules on a web host. Let's call them A::B and X::Y. X::Y depends on A::B (needs A::B to run). Both of them use Module::Install. I have successfully installed A::B into a non-system location using

perl Makefile.PL PREFIX=/non/system/location
make; make test; make install

Now I want to install X::Y, so I try the same thing

perl Makefile.PL PREFIX=/non/system/location

The output is

$ perl Makefile.PL PREFIX=/non/system/location/
Cannot determine perl version info from lib/X/Y.pm
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- Test::More          ...loaded. (0.94)
- ExtUtils::MakeMaker ...loaded. (6.54 >= 6.11)
- File::ShareDir      ...loaded. (1.00)
- A::B                ...missing.
==> Auto-install the 1 mandatory module(s) from CPAN? [y] 

It can't seem to find A::B in the system, although it is installed, and when it tries to auto-install the module from CPAN, it tries to write it into the system directory (ignoring PREFIX). I have tried using variables like PERL_LIB and LIB on the command line, after PREFIX=..., but nothing I have done seems to work.

I can do make and make install successfully, but I can't do make test because of this problem. Any suggestions?

I found some advice at http://servers.digitaldaze.com/extensions/perl/modules.html to use an environment variable PERL5LIB, but this also doesn't seem to work:

export PERL5LIB=/non/system/location/lib/perl5/

didn't solve the problem.

© Stack Overflow or respective owner

Related posts about perl

Related posts about perl-module