0

I am trying out some some custom modifications for the Template module. I downloaded it using:

$ cpan -g Template

Next, I wanted to install it into a custom folder such that my debug version did not overwrite the original installation.

I did a quick Google search, and found How can I install a CPAN module into a local directory?. According to that answer, I determined that I should be using INSTALL_BASE, for example:

perl Makefile.PL INSTALL_BASE=/home/hakon/perl/debug/lib
make
make install

But this does not work, it still installs (and overwrites) into the PERL5LIB directory where I have the installed the original module using cpanm. My path to PERL5LIB is /home/hakon/perl5. When I inspect the Makefile created by Makefile.PL, I can see that on line 21 there is:

#     INSTALL_BASE => q[/home/hakon/perl/debug/lib]

(note the comment in front), whereas on line 86 I have:

INSTALL_BASE = /home/hakon/perl5

Here is the whole Makefile.

Community
  • 1
  • 1
Håkon Hægland
  • 39,012
  • 21
  • 81
  • 174

1 Answers1

4

You are passing INSTALL_BASE=/home/hakon/perl5 to MakeMaker using env var PERL_MM_OPT. Unset it; it's overriding your command-line option.

Alternatively, set the env var instead of passing an argument.

export PERL_MM_OPT='INSTALL_BASE=/home/hakon/perl/debug/lib'
export PERL_MB_OPT='--install_base /home/hakon/perl/debug/lib'
cpan/cpanm/Makefile.PL/Build.PL ...
ikegami
  • 367,544
  • 15
  • 269
  • 518