How to install Carton module into local project with perlbrew?

633 views Asked by At

I use perlbrew to easy switch between perl. I use Carton to install modules only for current project into /local directory.

But when I deploy application on new host.

I do:

perlbrew install -v -j 8 --notest --switch perl-5.30.3
perlbrew install-cpanm
cpanm Carton

But last step will install Carton into perlbrew libs

Is there a way to install Carton into my project local/lib/perl5 directory?

I want to keep base perlbrew clean

1

There are 1 answers

0
Eugen Konkov On

To install modules into your own directory we can use --local-lib option.
It is mentioned here and described at examples cpanm --help

cpanm --local-lib ./local

probably useful options for this task are:

-n,--notest        Do not run unit tests
--self-contained   Install all non-core modules, even if they're already installed

If you do deploy often probably you do not need to retest each time. This is meaningless.

Second option is useful when you want modules to be installed into you local directory despite on they are already installed into system/brew perl