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

Ok, I'm using a script that uses LWP::Simple, but the server I'm using it on, doesnt have LWP::Simple installed on it and I don't have the permissions to get to & install anything in the perl/lib directory. So....I made a directory inside my home dir named "lib", and installed it in there. Here's the file tree (I've left out all the non-directory files outside of /lib)
public_html | +--cgi-bin | +--lib (chmodded 700) | | | +--LWP (chmodded 700) | | | | | +--Simple.pm (module I need to use, chmodded 755) | | | +--HTTP (chmodded 700) | | | +--Status.pm (needed by Simple.pm, chmodded 755) | +--script.cgi (script I'm accessing via browser, chmodded 755)
now, (these names are case-accurate by the way), in the script I have the following lines:
BEGIN { use CGI::Carp qw/fatalsToBrowser/; push(@INC,"/home/user/public_html/cgi-bin/lib"); }
And when I run it via browser, I get:
Can't locate LWP/Simple.pm in @INC (@INC contains: /usr/lib/perl5/5.6. +0/i386-linux /usr/lib/perl5/5.6.0 /usr/lib/perl5/site_perl/5.6.0/i386-linux /usr/li +b/perl5/site_perl/5.6.0 /usr/lib/perl5/site_perl . /home/user/public_html/cgi-bin/lib) at /home/user/public_html/cgi-bin/script.cgi line 10.
So...whats the problem?

Replies are listed 'Best First'.
Re: problem installing modules...
by Tuna (Friar) on Mar 03, 2001 at 00:44 UTC
    try:
    tar -xvpzf <module> perl Makefile.PL PREFIX=/path/to/local/module/directory make make test make install
    or insert the line:
    use CGI::Carp qw/fatalsToBrowser/; use lib /path/to/module
    or put this in your start-up script (if you're on a 'nix machine):
    $ export PERL5LIB=$HOME/perlib #or whatever your local dir. structure +is


    UPDATE: 3-9-01 removed "=" from "use lib" And no one called me on that???
Re: problem installing modules...
by Masem (Monsignor) on Mar 03, 2001 at 00:25 UTC
    Rough guess, try making all directores 755 OR make the owner the same as the web server. You need to be able to descend the dir tree with right permissions to get at a file, even if the file has the right permissions for you to be able to read it.