in reply to Re^3: Installing local Perl module
in thread Installing local Perl module

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.

Is the %ENV the same, are you using the same perl (path can change between users?

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.

Don't describe errors/warnings but copy/paste them instead, thanks

Replies are listed 'Best First'.
Re^5: Installing local Perl module
by Anonymous Monk on Apr 24, 2011 at 19:10 UTC

    Error:

    Software error: Can't locate DBI.pm in @INC (@INC contains: /home/salmonix/memdrive/FA +CER/TEST/face-r/index.pl /home/salmonix/perl5/lib/perl5 /usr/lib64/pe +rl5/site_perl/5.12.2/x86_64-linux-thread-multi /usr/lib64/perl5/site_ +perl/5.12.2 /usr/lib64/perl5/vendor_perl/5.12.2/x86_64-linux-thread-m +ulti /usr/lib64/perl5/vendor_perl/5.12.2 /usr/lib64/perl5/5.12.2/x86_ +64-linux-thread-multi /usr/lib64/perl5/5.12.2 /usr/lib64/perl5/site_p +erl /usr/lib64/perl5/vendor_perl .) at /home/salmonix/memdrive/FACER/ +TEST/face-r/index.pl line 18. BEGIN failed--compilation aborted at /home/salmonix/memdrive/FACER/TES +T/face-r/index.pl line 18. For help, please send mail to this site's webmaster, giving this error + message and the time and date of the error.

    My BEGIN block:

    BEGIN { my $lib1=$ENV{SCRIPT_FILENAME} || $ENV{PWD}; ($lib1)=($lib1=~/(\/home\/\w+\/)/); $lib1.="perl5/lib/perl5"; unshift @INC,$lib1; # map { print " $_\n" } @INC; }