sierrathedog04 has asked for the wisdom of the Perl Monks concerning the following question:

While attempting to install a Perl module on a Perl 5.003/Unix system I get the following error.
Error: Unable to locate installed Perl libraries or Perl source code. It is recommended that you install perl in a standard location before building extensions.
My perl executable is in /usr/bin . The environmental variables PERL5LIB and PERLLIB are not set.

I might mention that the machine I am installing to is archaic (it runs NCR's now-discontinued MP-RAS) and it has no internet connection so I cannot install modules from CPAN.

I wonder what to do. Reading the Perl documentation is not getting me anywhere. Any suggestions are appreciated.

  • Comment on 'Unable to locate installed Perl libraries' Error

Replies are listed 'Best First'.
(tye)Re: 'Unable to locate installed Perl libraries' Error
by tye (Sage) on Mar 24, 2001 at 02:15 UTC

    Well, I wasn't sure exactly what was meant by this so I looked at [trumpet fanfare] the source code ($Config{privlib}/ExtUtils/*) and found one occurrence of "Unable to locate" which was associate with not being able to find the file "perl.h".

    This file should be in the $Config{archlib}/CORE directory. MakeMaker not being able to find it probably means that Config.pm is out of tune.

    Look at the output from "perl -V" to see what $Config{privlib} and $Config{archlib} should be. The end of this output should list the contents of @INC which should include archlib, privlib, sitearch, and sitelib, in that order. If other directories are listed, then this may be your problem -- check your environment for things like PERL5LIB or PERL5OPT, etc. (see "perldoc perlrun" for more details on these things). Those directories are where the following things are put:

    archlib
    Architecture-specific files that are generated when you build perl (binary files and configuration-specific files like Config.pm and the generated perl.h)
    privlib
    Architecture-independent files that ship with perl (mostly of the *.pm files for standard modules)
    sitearch
    Architecture-specific files that are generated when you add modules (such as the shared libraries that are created for dynamically loadable modules)
    sitelib
    Architecture-independent files that come with modules that you add on (mostly *.pm files)

    Then see which version of Config.pm is being use, for example via: perl -MConfig -e 'print $INC{"Config.pm"}' You should be using the one in archlib. Then see what Config.pm thinks these values are:

    perl -MConfig -de 0 DB<1> x @Config{qw( archlib privlib sitearch sitelib )} DB<2> q
    then go look in $Config{archlib}/CORE where you should find a bunch of *.h files and libperl.a.

    I hope that along the way of doing that you'll be able to figure out what is wrong and perhaps how to fix it.

            - tye (but my friends call me "Tye")
      I prefer perl -V:archlib -V:privlib -V:sitearch -V:sitelib, but you probably knew that ;) `perl --help', `perldoc perlrun'


      MJD says you can't just make shit up and expect the computer to know what you mean, retardo!
      I run a Win32 PPM repository for perl 5.6x+5.8x. I take requests.
      ** The Third rule of perl club is a statement of fact: pod is sexy.