views:

56

answers:

2

Hi, I'd like to use a home directory specific, non-root directory for stuff I install from cpan. How can I configure it?

Normal CPAN configuration tries to install packages into /usr. After adding 'makepl_arg' => q[PREFIX=~/cpan_local], simple packages seem to build, but I cannot build a package that pulls its dependencies - the dependency is not found.

After I changed it to 'makepl_arg' => q[PREFIX=~/cpan_local LIB=~/cpan_local], I get the following message: Warning: Prerequisite 'ExtUtils::CBuilder => 0.27' for 'D/DA/DAGOLDEN/Module-Build-0.3607.tar.gz' already installed but installation looks suspicious. Skipping another installation attempt, to prevent looping endlessly.

How can I configure this properly? I want everything that's built to do to ~/cpan_local automatically. (or for people familiar with python, I'd like this to work like virtual-env and running easy_install from it).

+2  A: 

Use local::lib. The bootstrap instructions should do the trick for you.

David Dorward
+4  A: 

Even better, install App::cpanminus first. Then just use it to install modules as a regular user. If this user can't write to the /usr/local/lib/perl* directories it will resort to writing in its home directory, or you pass it the -l or --local-lib option to directly install it in your home directory without it figuring out if it can install them system wide.

Finally, installing local::lib and setting up your environment automatically with your .bashrc file will allow you to omit the --local-lib option and install to your home directory directly.

Htbaa