Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with installing LWP w/Perl 5.005

Status
Not open for further replies.

dunsel

Technical User
Jan 5, 2001
2
US
Pardon me if this is a stupid question. I'm kinda new at Perl. I'm trying to run a Perl script that uses the LWP library and have been getting a strange error. LWP was recently installed on this older Perl (5.005) and now it can't seem to find LWP. My host attempted a Perl 5.6 installation and failed miserably at it so it's either get LWP working with 5.005 or (shudder) find a PhP solution. Any suggestions would be greatly appreciated.

Here's the start of my script.

#!/usr/bin/perl
#
#-----
#comment lines snipped
#-----

use LWP::Simple;
use LWP::UserAgent;

-------------------------------------
Here's the error we're getting:

Can't locate LWP/Simple.pm in @INC (@INC contains: /usr/libdata/perl/5.00503/mach /usr/libdata/perl/5.00503 /usr/local/lib/perl5/site_perl/5.005/i386-freebsd /usr/local/lib/perl5/site_perl/5.005 .) at /nfs/home/d/u/dunsel/public_html/cgi-bin/odp/odp.pl line 9.
BEGIN failed--compilation aborted at /nfs/home/d/u/dunsel/public_html/cgi-bin/odp/odp.pl line 9.
[Fri Jan 5 18:39:04 2001] [error] [client 198.77.208.4] Premature end of script headers: /nfs/home/d/u/dunsel/public_html/cgi-bin/odp/odp.pl
----------------------------------------
Here's the directory with Simple.pm

> root@uws1:/usr/local/lib/perl5/site_perl/5.005/LWP
> total 62
> drwxr-xr-x 4 root wheel 512 Jan 5 18:36 .
> drwx------ 16 root wheel 512 Jan 5 23:55 ..
> drwxr-xr-x 2 root wheel 512 Jan 5 18:36 Authen
> -r--r--r-- 1 root wheel 3104 Dec 2 1997 Debug.pm
> -r--r--r-- 1 root wheel 7036 Nov 16 1999 MediaTypes.pm
> -r--r--r-- 1 root wheel 900 Dec 2 1997 MemberMixin.pm
> drwxr-xr-x 2 root wheel 512 Jan 5 18:36 Protocol
> -r--r--r-- 1 root wheel 7982 Apr 9 2000 Protocol.pm
> -r--r--r-- 1 root wheel 6932 Apr 9 2000 RobotUA.pm
> -r--r--r-- 1 root wheel 8069 May 24 2000 Simple.pm
> -r--r--r-- 1 root wheel 20137 Jun 1 2000 UserAgent.pm
> -r--r--r-- 1 root wheel 2828 Nov 11 1996 media.types
> root@uws1:/usr/local/lib/perl5/site_perl/5.005/LWP
---------------------------------------------------------
And here's a dump of my hosts re-install of LWP thinking it was bad.

> root@xxx1:~# perl -MCPAN -e 'install Bundle::LWP'
> Going to read /home/nbd/.cpan/sources/authors/01mailrc.txt.gz
> CPAN: Compress::Zlib loaded ok
> Going to read
> /home/nbd/.cpan/sources/modules/02packages.details.txt.gz
> Going to read /home/nbd/.cpan/sources/modules/03modlist.data.gz
> URI is up to date.
> Net::FTP is up to date.
> MIME::Base64 is up to date.
> Digest::MD5 is up to date.
> HTML::HeadParser is up to date.
> LWP is up to date.

The directory above LWP appears to be in Perl's search path which I though was all that was needed. LWP is installed and the uses statement is right... what are we doing wrong. Please explain in details I'm still a Perl neophyte.

Thanks for any help you can give.
 
I might be way off track here, but here is my thought...

It looks like the error message you are reproducing is
coming from a web server which is running the script from
an nfs drive located on another machine?

If this is the case, you need to have LWP installed on the
web server machine (maybe you already do? Is the web server
xxx1 and the nfs drive with odp.pl is on machine uws1?)

Anyway, after I'm done blathering, I'd log on to the web
server machine, go to directory /nfs/home/d/u/dunsel/public_html/cgi-bin/odp/
and try a 'perl -c odp.pl' command. If this fails, you
need to get LWP on the web server, or modify @INC in
odp.pl to use an (nsf mounted?) LWP from somewhere else.
 
Thanks for your suggestions.
I've tried running Perl with the -c option, no luck.
I modified the @inc to look in the LWP directory,
No luck

My host has finally conceeded though. He claims he'll be building a new server within the week for us 'sophisticated' types. Didn't know I'd graduated. Hopefully, that will solve my problems.

-Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top