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

Dear monks,

I need to install several cpan modules, with their dependencies, on an account where I don't have root access. The system has perl v.5.6.1 + core modules installed. I want to be able to install additional modules to ~/perl, from cpan. So, I figure I should start the cpan shell as perl -I~/perl -MCPAN -e shell and then run o conf init to install the cpan folder tree to ~/.cpan and set PREFIX=~/perl. This works insofar that modules with satisfied dependencies build just fine and install in the right folders. But when I try to build modules with dependencies from cpan the extra paths in @INC don't seem to get picked up, so make test fails. What am I doing wrong?

Thanks!

Replies are listed 'Best First'.
Re: cpan when not as root
by Fletch (Bishop) on May 17, 2006 at 20:59 UTC

    Try setting PERL5LIB instead of using -I; the later won't propagate to child perl invocations but the former will.

      This by itself does not seem to solve the problem. For clarity: I'm on a redhat beowulf cluster, and I'd like to use bash as my shell, so I set PERL5LIB=~/perl in my .bashrc. Then, I start cpan (perl -MCPAN -e shell) and set the configuration (o conf init) for perl Makefile.PL to PREFIX=~/perl LIB=~/perl, but what about make, make test, make install? Do I set -I~/perl?

      For example, I need to install Test::Harness. The cpan shell goes through all the motions, and Test::Harness ends up in ~/perl, but the next time I issue "install Test::Harness" it goes through the whole procedure again rather than simply saying it's up to date?!

      Thanks!
        I start cpan (perl -MCPAN -e shell) and set the configuration (o conf init) for perl Makefile.PL to PREFIX=~/perl LIB=~/perl, but what about make, make test, make install?

        The "make" and "make install" will do the right thing based on having the "PREFIX=..." set for the "perl Makefile.PL" step. That prefix setting propogates through the following steps.

        (If you've tried that and it doesn't work that way for you, then I'm confused -- it works that way for me on freebsd.)

Re: cpan when not as root
by moklevat (Priest) on May 18, 2006 at 16:13 UTC