Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cpan shell and MyConfig.pm problem

5 views
Skip to first unread message

Ronny

unread,
May 7, 2008, 6:31:56 AM5/7/08
to
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

brian d foy

unread,
May 8, 2008, 1:53:14 PM5/8/08
to
In article
<e71040c4-5f85-4266...@r66g2000hsg.googlegroups.com>,
Ronny <ro.nald...@gmail.com> wrote:

> 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 :)

Ronny

unread,
May 9, 2008, 5:29:10 AM5/9/08
to
On 8 Mai, 19:53, brian d foy <brian.d....@gmail.com> wrote:
> In article
> <e71040c4-5f85-4266-b07d-d35b1fc38...@r66g2000hsg.googlegroups.com>,

> Ronny <ro.naldfi.sc...@gmail.com> wrote:
> > 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.
> 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

0 new messages