change cpan install directory

10,176

The destination to which CPAN installs modules can be changed by setting its options (run o conf in the CPAN shell):

makepl_arg         [INSTALL_BASE=/home/gokcehan/.perl5]
mbuildpl_arg       [--install_base=/home/gokcehan/.perl5]

To let CPAN and Perl search for modules in the given path, set the environment variable PERL5LIB:

PERL5LIB=/home/gokcehan/.perl5:/home/gokcehan/.perl5/$arch

where $arch is the output of

use Config;
print Config->{archname};
Share:
10,176

Related videos on Youtube

none
Author by

none

Updated on September 18, 2022

Comments

  • none
    none over 1 year

    I have tried to setup cpan on my ubuntu 12.04 using:

    sudo cpan
    

    and it created a folder perl5 in my $HOME folder. I would like to use a different directory such as $HOME/.perl5 or somewhere in /usr/local/lib for the modules. Is it possible?

  • Admin
    Admin almost 2 years
    Can we do same but via cpan options?