in reply to Set Install path in CPAN
When the CPAN shell starts, if it finds a file called ~/.cpan/CPAN/MyConfig.pm it will use that as the configuration file instead of the default one root has in its home directory.
So, run:
$ mkdir -p ~/.cpan/CPAN
and then run:
$ cp /root/.cpan/CPAN/Config.pm ~/.cpan/CPAN/MyConfig.pm
or even just:
$ touch ~/.cpan/CPAN/MyConfig.pm
Now, when you run:
$ perl -MCPAN -e shell
At the cpan prompt tell it to initialize the configuration:
cpan> o conf init
CPAN will go through its initialization process, and ask you a bunch of questions (including what to set as arguments to Makefile.PL, which tells make install where to put the files. When it is done, you can use the cpan shell to install modules in a user defined location.
Note that when installing libraries that have dependencies that are installed in your local directory, perl needs to be able to find them. So what I do is set PERL5LIB when I run cpan:
$ PERL5LIB=~/perl/lib perl -MCPAN -e shell
Enjoy,
trwww
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Set Install path in CPAN
by compused (Acolyte) on Feb 14, 2012 at 06:58 UTC | |
by Anonymous Monk on Feb 14, 2012 at 10:28 UTC | |
by compused (Acolyte) on Feb 14, 2012 at 12:52 UTC |