Hue-Bond has asked for the wisdom of the Perl Monks concerning the following question:

I wanted to experiment with the CPAN module so I run perl -MCPAN -e shell, configured it and tried to reinstall two modules that I previously had installed by hand. Everything went ok and the modules ended up under the PREFIX directory I specified during CPAN configuration. This line caught my attention: Appending installation info to /home/hue/lang/perl/modules/lib/perl/5.8.7/perllocal.pod. I went to see that file with perldoc and discovered what seems to be an installation log. Great! It reads:

Sat Sep 24 12:24:26 2005: "Module" Digest::SHA - "installed into: /home/hue/lang/perl/modules/share/perl/5.8 +.7" - <blah> Sat Sep 24 12:30:21 2005: "Module" Language::Befunge - "installed into: /home/hue/lang/perl/modules/share/perl/5.8 +.7" - <blah>

But when I go to the filesystem to check this, I find:

|-- lib | `-- perl | `-- 5.8.7 | |-- Digest | | `-- SHA.pm | |-- auto | | |-- Digest | | | `-- SHA | | | |-- SHA.bs | | | `-- SHA.so | | `-- Language | | `-- Befunge | `-- perllocal.pod |-- share | `-- perl | `-- 5.8.7 | `-- Language | |-- Befunge | | `-- <blah> | `-- Befunge.pm

That is, SHA.pm is under lib/perl/5.8.7 but Befunge.pm under share/perl/5.8.7.

I did export PERL5LIB=~/lang/perl/modules/lib/perl/5.8.7 and now I can use Digest::SHA; but when I use Language::Befunge; I get the usual error message telling me that Language/Befunge.pm is not in @INC. If I export PERL5LIB=~/lang/perl/modules/share/perl/5.8.7, I can use Language::Befunge; but not Digest::SHA. As expected :^).

My question is, why perllocal.pod says both modules are in share/perl/5.8.7 when it's not true?

--
David Serrano

Replies are listed 'Best First'.
Re: Modules installation path
by merlyn (Sage) on Sep 24, 2005 at 15:04 UTC
    What distro is this? Did you install the Perl yourself? It sounds like there is a disagreement between the original values for module installation and the current values, perhaps from something editing Config.pm after installation (never a good idea). What does perl '-V:install.*' show for installation directories?

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

      This is Debian unstable. I didn't compile Perl, it is Debian's 5.8.7-4.

      $ perl '-V:install.*' installarchlib='/usr/lib/perl/5.8'; installbin='/usr/bin'; installhtml1dir=''; installhtml3dir=''; installman1dir='/usr/share/man/man1'; installman3dir='/usr/share/man/man3'; installprefix='/usr'; installprefixexp='/usr'; installprivlib='/usr/share/perl/5.8'; installscript='/usr/bin'; installsitearch='/usr/local/lib/perl/5.8.7'; installsitebin='/usr/local/bin'; installsitehtml1dir=''; installsitehtml3dir=''; installsitelib='/usr/local/share/perl/5.8.7'; installsiteman1dir='/usr/local/man/man1'; installsiteman3dir='/usr/local/man/man3'; installsitescript='/usr/local/bin'; installstyle='lib/perl5'; installusrbinperl='undef'; installvendorarch='/usr/lib/perl5'; installvendorbin='/usr/bin'; installvendorhtml1dir=''; installvendorhtml3dir=''; installvendorlib='/usr/share/perl5'; installvendorman1dir='/usr/share/man/man1'; installvendorman3dir='/usr/share/man/man3'; installvendorscript='/usr/bin'; $ grep -wE "lib|share" $(locate Config.pm) /usr/lib/perl/5.8.7/Config.pm:die "Perl lib version (v5.8.7) doesn't m +atch executable version ($])" /usr/lib/perl/5.8.7/Config.pm: or die "Perl lib version (v5.8.7) do +esn't match executable version (" . /usr/lib/perl/5.8.7/Config.pm: archlibexp => '/usr/lib/perl/5.8', /usr/lib/perl/5.8.7/Config.pm: libpth => '/usr/local/lib /lib /usr/ +lib', /usr/lib/perl/5.8.7/Config.pm: privlibexp => '/usr/share/perl/5.8', /usr/lib/perl/5.8.7/Config.pm: sitearchexp => '/usr/local/lib/perl/ +5.8.7', /usr/lib/perl/5.8.7/Config.pm: sitelibexp => '/usr/local/share/perl +/5.8.7', /usr/share/perl5/Debconf/Config.pm:our @config_files=("/etc/debconf.co +nf", "/usr/share/debconf/debconf.conf");

      I never touched any Config.pm. Actually, I know very little about how Perl works. I'm inclined to think that the cause of this has to do with the modules themselves, its their Makefiles or so. I can paste them in my scratchpad (appropriately trimmed) if it matters.

      --
      David Serrano