Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

perlbrew seems to ignore PERLBREW_ROOT

by tospo (Hermit)
on Nov 29, 2013 at 12:22 UTC ( #1064947=perlquestion: print w/replies, xml ) Need Help??
tospo has asked for the wisdom of the Perl Monks concerning the following question:

I just started to use perlbrew on an Ubuntu Precise installation and I guess I'm doing something wrong but can't figure it out.

I want to install my perls into a nfs mounted directory /software/lib/perl5/perlbrew
I set PERLBREW_ROOT to that directory and the two perl versions I installed so far have both correctly been installed there.
I also added export PERLBREW_ROOT=/software/lib/perl5/perlbrew to my .bashrc and I can confirm in a terminal that this is indeed set correctly.
In addition, perlbrew info also confirms that PERLBREW_ROOT is set to the above directory.

However, when I install a module like this

perlbrew exec --with 5.14.2 cpanm Module::Build
It is successfully installed in my home directory under ${HOME}/lib/perl5 and I can't figure out why. Any clues what I might be doing wrong?
I can also confirm that the cpanm that is used appears to be the one installed with perlbrew (it's in the perlbrew path given above) Thanks for your help!

Turns out (thanks Corion) that it was an old .modulebuildrc file that had set the install_base to my home dir, so all modules based on Module::Build ended up there.

Replies are listed 'Best First'.
Re: perlbrew seems to ignore PERLBREW_ROOT
by tospo (Hermit) on Nov 29, 2013 at 12:33 UTC
    hmm, I have just seen that PERL5LIB isn't set at all but I'm not sure if that's the expected behaviour of perlbrew or should perlbrew have set it according to the perl version used?
Re: perlbrew seems to ignore PERLBREW_ROOT
by tospo (Hermit) on Nov 29, 2013 at 13:55 UTC
    another thing I just tested is the output of
    $ perl "-V:install.*"
    which confirms that "installprefix" is the /software/lib/perl5/perlbrew directoy for the perl version I have currently selected.
    I read that cpanm installs modules in ${HOME}/lib/perl5 if it thinks that the current user has no permissions to install system-wide but I do have permissions on the directories under my perlbrew directory and I verified that I can write to them so I'm completely lost now what the problem might be.
Re: perlbrew seems to ignore PERLBREW_ROOT
by tospo (Hermit) on Nov 29, 2013 at 14:35 UTC
    It seems that this is a problem only with Module::Build.
    I just tried to install something else (Text::CSV) and it installed in the /software path just as it should.
    Unfortunately, half of CPAN depends on Module::Build and I just can't get it installed
      actually, I guess it's a problem with everyting that uses Module::Build (which Text::CSV does't). I just tried to install Module::Info and that too ends up in my home directory.

        In theory, Module::Build should respect whatever the current Perl tells it about module locations. Do you maybe have a leftover .modulebuildrc somewhere that screws up your configuration? Are there maybe Module::Build-specific environment variables?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1064947]
Front-paged by Corion
[Discipulus]: problematic? i came back after just a week of course, I forgo teverything..

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2017-12-18 11:22 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (483 votes). Check out past polls.