2

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

Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158
  • This is so backwards X_X I'm always recommending that people install a local `perl` to avoid "local libs" and all the problems this causes. You have that, but you seek to reintroduce all the problems! Nothing stops you from having more than one install of a version of Perl is you want a clean one and a not-so-clean one. See the `--as` argument of `perlbrew install`. – ikegami Oct 27 '20 at 10:30

1 Answers1

2

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

Eugen Konkov
  • 22,193
  • 17
  • 108
  • 158