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

I've got a shared-hosting account where I configured my CPAN to do all sorts of installs into a ~/perlmods dir so I can install modules without root rights: Still there seems to be one step which I haven't modified to go into my relative dir... (or is this one hardcoded in the mod?)
Running Build install Prepending /home/isync/.cpan/build/KinoSearch-0.30_122-jGNB5K/blib/arc +h /home/isync/.cpan/build/KinoSearch-0.30_122-jGNB5K/blib/lib to PERL +5LIB for 'install' Building KinoSearch Files found in blib/arch: installing files in blib/lib into architectu +re dependent library tree !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! ERROR: Can't create '/usr/local/lib/perl/5.10.0' mkdir /usr/local/lib/perl: Permission denied at /usr/share/perl/5.10/E +xtUtils/Install.pm line 479 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!! at /home/isync/perlmods/share/perl/5.10/Module/Build/Base.pm line 333 +4 CREAMYG/KinoSearch-0.30_122.tar.gz ./Build install -- NOT OK
my CPAN/MyConfig.pm:
$CPAN::Config = { 'auto_commit' => q[1], 'build_cache' => q[100], 'build_dir' => q[/home/isync/.cpan/build], 'cache_metadata' => q[1], 'commandnumber_in_prompt' => q[1], 'cpan_home' => q[/home/isync/.cpan], 'ftp_passive' => q[1], 'ftp_proxy' => q[], 'http_proxy' => q[], 'inactivity_timeout' => q[0], 'index_expire' => q[1], 'inhibit_startup_message' => q[0], 'keep_source_where' => q[/home/isync/.cpan/sources], 'make_arg' => q[], 'make_install_arg' => q[], 'make_install_make_command' => q[/usr/bin/make], 'makepl_arg' => q[PREFIX=~/perlmods], 'mbuild_arg' => q[], 'mbuild_install_arg' => q[], 'mbuild_install_build_command' => q[./Build], 'mbuildpl_arg' => q[PREFIX=~/perlmods], 'no_proxy' => q[], 'prerequisites_policy' => q[follow], 'scan_cache' => q[atstart], 'show_upload_date' => q[0], 'term_ornaments' => q[1], 'urllist' => [q[ftp://cpan.erlbaum.net/CPAN/], q[ftp://cpan.mirrors. +tds.net/pub/CPAN], q[ftp://ftp.ndlug.nd.edu/pub/perl/]], 'use_sqlite' => q[0], }; 1; __END_
So, which step of CPAN triggers this "ERROR: Can't create '/usr/local/lib/perl/5.10.0'" - so I can tell it to go into ~/perlmods?

As I understand it, I've managed to tell the make process behind CPAN which is triggered by ExtUtils::MakeMaker to use a custom PERL_LIB var, but not that it should also override the PERL_ARCHLIB var, right? How can I do this?

Replies are listed 'Best First'.
Re: CPAN: quick help with user-space install needed
by moritz (Cardinal) on Oct 11, 2010 at 11:43 UTC
    I don't know which magicl knob you have to turn to make it work - it never worked for me when I tried it on my own.

    But luckily local::lib can do the magical knob turning for you - with it local modulation installation has always worked for me.

    Perl 6 - links to (nearly) everything that is Perl 6.
      As I see it "local::lib" is what you use when you run a script relying on modules in another location.

      My problem arises while *installing* a module in a path differing from the standard locations. (The error here is that CPAN is trying to write a part of the module's files into the standard path, a path I have no rights to write to...)
        local::lib does influence the installing process of modules (hey, even the synopsis shows its usage together with CPAN.pm!). And as I said before, it worked for me (both for the installing and using modules).
Re: CPAN: quick help with user-space install needed
by isync (Hermit) on Oct 11, 2010 at 13:11 UTC
    Installing with App::cpanminus to /home/isync/perl5 (cpanm's automagic/default dir) did the trick.
Re: CPAN: quick help with user-space install needed
by FunkyMonk (Bishop) on Oct 11, 2010 at 14:56 UTC
Re: CPAN: quick help with user-space install needed
by locked_user sundialsvc4 (Abbot) on Oct 11, 2010 at 14:36 UTC

    I’m quite sure that the information is also on this site (many times over...) but I did a quick Google on perl non-root or CPAN non-root and there are many descriptions of how this magick is done.

Re: CPAN: quick help with user-space install needed
by Anonymous Monk on Oct 11, 2010 at 13:04 UTC

    Check the CPAN configuration.   There are variables (“such as PREFIX,” he said with the suddenly-vague expression of someone who’s had only one cup of coffee...) which influence exactly how and where CPAN tries to put things.

    I have always used absolute addresses here.   In other words, figure out what "~" corresponds to (it doesn’t change...), and specify the directory explicitly.

    “Okay, that’s it ... time for coffee,” he mumbled...

      To be sure, I already tried abs paths, still no success. But using my current (incomplete?) prefix setup above, I was able to install cpanminus, and it placed the _libarch stuff and everything else clevery beneath the ~/perl5 path.