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

Hi, I’m trying to install a local module in a webserver that isn’t mine. Up until now the directory /home/username/usr/lib/perl5/site_perl/5.6.1 wasn’t created until I used the PREFIX with “perl Makefile.PL”. The “INSTALLMAN3DIR = /home/username/usr/lib/perl5/man/man3 ” gave me an error. But now, I get no error with the following Makefile.PL
#!/usr/local/bin/perl use 5.008007; use ExtUtils::MakeMaker; # See lib/ExtUtils/MakeMaker.pm for details of how to influence # the contents of the Makefile that is written. WriteMakefile( NAME => 'Kepler', VERSION_FROM => 'lib/Kepler.pm', # finds $VERSION PREREQ_PM => {}, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'lib/Kepler.pm', AUTHOR => 'Kepler <me@me.com>') : ()), LIBS => ['-L/home/username/usr/local/lib -lskepler'], # LIBS => ['-lskepler'], # e.g., '-lm' DEFINE => '', # e.g., '-DHAVE_SOMETHING' INC => '-I/home/username/usr/local/include', # INSTALL_BASE => '/home/username/usr/local', PREFIX => '/home/username/usr/local/lib/perl5/site_perl +/5.6.1', INSTALLMAN3DIR => '/home/username/usr/local/lib/perl5/man/man3' +, # DISTVNAME => 'perl_kepler', # # Un-comment this if you add C files to link with later: # OBJECT => '$(O_FILES)', # link all the C files too );
Before everything, I put in the scripts - which gives no error:
use lib qw(/home/username/usr/local/lib/perl5/site_perl/5.6.1);
I get the error - in the test.pl script:
Can't locate Kepler.pm in @INC (@INC contains: /home/username/usr/loca +l/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.8.8/i386-linux +-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl + /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/pe +rl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8 +/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at test.pl line 6.
like the module isn't there. Can you help me out? Kind regards, Kepler

Replies are listed 'Best First'.
Re: Installing local Perl module
by moritz (Cardinal) on Feb 07, 2011 at 13:37 UTC

    Are you trying to install a module that requires Perl 5.8.7 on a perl 5.6.1? This is just asking for trouble.

    I’m trying: “use Kepler qw(:all);” and I get “Internal Server Error”

    Time to look at the web server's error log.

    It might also help to just run the CGI script from the command line, and see what kidn of output it produces.

    And finally local::lib has helped me greatly with local perl module installations, I can highly recommend it.

Re: Installing local Perl module
by CountZero (Bishop) on Feb 07, 2011 at 13:53 UTC
    “Internal Server Error” is not a very useful error message.

    You will have to look into the server error logs to find out what exactly went wrong.

    It may very well be that the Perl-version run by the server does not know about your locally installed modules and/or has not the required privileges to access or run such module. The web-server usually runs with a very restricted environment and very low privileges.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Installing local Perl module
by Anonymous Monk on Feb 07, 2011 at 14:21 UTC
      Hi, It could be the priveleges... I get the error:
      Can't locate Kepler.pm in @INC (@INC contains: /home/username/usr/loca +l/lib/perl5/site_perl/5.6.1 /usr/lib/perl5/site_perl/5.8.8/i386-linux +-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl + /usr/lib/perl5/vendor_perl/5.8.8/i386-linux-thread-multi /usr/lib/pe +rl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8 +/i386-linux-thread-multi /usr/lib/perl5/5.8.8 .) at test.pl line 6.
      I know that it detects:
      /home/username/usr/local/lib/perl5/site_perl/5.6.1
      It detects the use of "use lib qw(/home/cosmos/usr/local/lib/perl5/site_perl/5.6.1);" would give an error otherwise, right? - and I've tryed separetly. But why not the module? It's not there? Regards, Kepler

        My problem is the same. I have put use lib in BEGIN block. I have checked that my locally installed modules are in the @INC, and everything is fine when I run the script from terminal - but not found when I access the script via browser. Permissions are rwx-rx-x, http server (lighty) runs as root.

        Only globally installed modules and those under ./ are loaded. Strange enough I received no error from CGI::Debug, only use warning pragma dropped the usual not in @INC message.