macosperlubuntulocallib

Specify location for the local perl library


Basically, I tried this on Ubuntu and OS X:

export PERL_LOCAL_LIB_ROOT=~/.perl5
wget -O- http://cpanmin.us | perl - -l ~/.perl5 App::cpanminus local::lib
eval `perl -I ~/.perl5/lib/perl5 -Mlocal::lib`

Yet the third line insists on creating and installing all the stuff in ~/perl5 rather than ~/.perl5. How can I overcome this behaviour?


Solution

  • From the docs,

    [If you installed local::lib into] a directory other than default, you also need to give that as import parameter to the call of the local::lib module like this way:

    echo 'eval "$(perl -I$HOME/foo/lib/perl5 -Mlocal::lib=$HOME/foo)"' >>~/.bashrc
    

    So you need

    echo 'eval "$(perl -I$HOME/.perl5/lib/perl5 -Mlocal::lib=$HOME/.perl5)"' >>~/.bashrc