cpan shell and MyConfig.pm problem

R

Ronny

I would like to install CPAN modules with the cpan command. Since I
don't have
write permission to the Perl installation directories, I need to do a
local installation.

After playing around with the cpan command a bit and looking at the
source code of
CPAN::Config, I created a $HOME/.cpan/CPAN/MyConfig.pm with the
following content:

$CPAN::Config->{cpan_home}="$ENV{HOME}/.cpan";
$CPAN::Config->{keep_source_where}=$CPAN::Config->{cpan_home}.'/
sources';
$CPAN::Config->{histfile}=$CPAN::Config->{cpan_home}.'/history';
$CPAN::Config->{build_dir}=$CPAN::Config->{cpan_home}.'/build';

This works fine for download and test, but install still tries to
write the modules into
the Perl installation directory. In addition, I get during install the
error message

sh: /Perl/cpan-autoconfig: not found

What is broken here?

Ronald
 
B

brian d foy

Ronny said:
I would like to install CPAN modules with the cpan command. Since I
don't have
write permission to the Perl installation directories, I need to do a
local installation.

For using the cpan command, configure your CPAN.pm with the right
values in:

make_arg arguments that should always be passed to 'make'
make_install_make_command
the make command for running 'make install', for
example 'sudo make'

make_install_arg same as make_arg for 'make install'
makepl_arg arguments passed to 'perl Makefile.PL'
mbuild_arg arguments passed to './Build'
mbuild_install_arg arguments passed to './Build install'

mbuild_install_build_command
command to use instead of './Build' when we are
in the install stage, for example 'sudo ./Build'

mbuildpl_arg arguments passed to 'perl Build.PL'


For instance, you might set makepl_arg to "PREFIX=~/lib" to install
things in the lib directory inside your home directory.
After playing around with the cpan command a bit and looking at the
source code of
CPAN::Config, I created a $HOME/.cpan/CPAN/MyConfig.pm with the
following content:

The CPAN::FirstTime module can help you make a configuration file. My
first guess would be that making by hand meant you left out something.

Good luck :)
 
R

Ronny

The CPAN::FirstTime module can help you make a configuration file. My
first guess would be that making by hand meant you left out something.

Thanks a lot. So I started again the cpan shell, did

o config init

to run again FirstTime, set the PREFIX variable and now everything
works
as expected!

Ronald
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,737
Latest member
Georgeengab

Latest Threads

Top