in reply to installing CPAN modules locally with a local perl installation

For reasons that I don't understand, it makes a difference where I attempt to install a CPAN module from.

I configured and built perl from /home/me/build/perl/perl-5.8.8 and have been attempting to configure and install CPAN modules from /home/me/build/perl-addons/tmp/<Module>. I've been trying to force ExtUtils::MakeMaker to recognize the perl directory by supplying a PERL_LIB and PERL_ARCHLIB.

If I simply work from /home/me/build/perl/perl-5.8.8/<Module> then ExtUtils::MakeMaker finds everything with no coercion necessary; the warnings about Config.pm and architecture go away.

This leads me to think that maybe I'm not passing the right parameters to perl Makefile.PL (currently PREFIX, PERL_LIB, and PERL_ARCHLIB). A quick read through ExtUtils::MakeMaker's perldoc seems to indicate that only PERL_LIB and PERL_ARCHLIB should be necessary. Setting PERL_SRC (which happens automatically when working from /home/me/build/perl/perl-5.8.8/<Module>) throws a warning when working out of /home/me/build/perl-addons/tmp/<Module>.

So, this allows me to accomplish what I'm trying to do, and even simplifies the process a little but I don't understand why ExtUtils::MakeMaker is behaving this way and why the flags that I was passing in before weren't sufficient.
  • Comment on Re: installing CPAN modules locally with a local perl installation

Replies are listed 'Best First'.
Re^2: installing CPAN modules locally with a local perl installation
by Anonymous Monk on Jan 29, 2007 at 20:53 UTC
    Ah, the warning that I was getting about PERL_SRC turned out to be operator error:
    [me@unixbox1:/home/me/build/perl-addons/tmp/HTML-Template-2.8]> perl M +akefile.PL PERL_SRC=/home/me/build/perl/inst/usr/local Checking if your kit is complete... Looks good You cannot build extensions below the perl source tree after executing a 'make clean' in the perl source tree. To rebuild extensions distributed with the perl source you should simply Configure (to include those extensions) and then build perl as normal. After installing perl the source tree can be deleted. It is not needed for building extensions by running 'perl Makefile.PL' usually without extra arguments. It is recommended that you unpack and build additional extensions away from the perl source tree. Warning: PERL_LIB (/home/me/build/perl/inst/usr/local/lib) seems not t +o be a perl library directory (Exporter.pm not found) at /home/me/build/perl/inst/usr/local/ +lib/perl5/5.8.8/ExtUtils/MM_Unix.pm line 1668. Writing Makefile for HTML::Template
    Setting PERL_SRC to /home/me/build/perl/perl-5.8.8 (which is the equivalent path that ExtUtils::MakeMaker was defaulting to when installing CPAN modules from /home/me/build/perl/perl-5.8.8/<Module>) doesn't display that message.

    Now, I'm conflicted. The perldoc for ExtUtils::MakeMaker says that you should only use PERL_SRC if Perl hasn't been installed. I HAVE installed Perl, albeit to a local directory, via make install DESTDIR=/home/me/build/perl/inst. My interpretation of the documentation implies that what I'm doing isn't correct even though it (now) seems to work.