Problem Installing HTTP::Client

X

Xzanron

Hi

I'm new to perl and i'm trying to install the HTTP::Client module.
It says the test failed. I have no idea what to do now.

I run perl -MCPAN -e shell

install HTTP::Client

and get the following:

CPAN: Storable loaded ok
Going to read /root/.cpan/Metadata
Database was generated on Tue, 18 Oct 2005 14:00:36 GMT
Running install for module HTTP::Client
Running make for L/LI/LINC/HTTP/HTTP-Client-1.51.tar.gz
CPAN: Digest::MD5 loaded ok
CPAN: Compress::Zlib loaded ok
Checksum for
/root/.cpan/sources/authors/id/L/LI/LINC/HTTP/HTTP-Client-1.51.tar.gz
ok
Scanning cache /root/.cpan/build for sizes
HTTP-Client-1.51/
HTTP-Client-1.51/.DS_Store
HTTP-Client-1.51/Changes
HTTP-Client-1.51/lib/
HTTP-Client-1.51/lib/.DS_Store
HTTP-Client-1.51/lib/HTTP/
HTTP-Client-1.51/lib/HTTP/Client.pm
HTTP-Client-1.51/Makefile.PL
HTTP-Client-1.51/MANIFEST
HTTP-Client-1.51/README
HTTP-Client-1.51/test.pl
Removing previously used /root/.cpan/build/HTTP-Client-1.51

CPAN.pm: Going to build L/LI/LINC/HTTP/HTTP-Client-1.51.tar.gz

Checking if your kit is complete...
Looks good
Writing Makefile for HTTP::Client
cp lib/HTTP/Client.pm blib/lib/HTTP/Client.pm
cp lib/.DS_Store blib/lib/.DS_Store
Manifying blib/man3/HTTP::Client.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.8.7 "-Iblib/lib" "-Iblib/arch" test.pl
Global symbol "$file" requires explicit package name at
blib/lib/HTTP/Client.pm line 44.
Global symbol "$file" requires explicit package name at
blib/lib/HTTP/Client.pm line 45.
Global symbol "$file" requires explicit package name at
blib/lib/HTTP/Client.pm line 48.
Compilation failed in require at test.pl line 3.
BEGIN failed--compilation aborted at test.pl line 3.
make: *** [test_dynamic] Error 9
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force
 
A

A. Sinan Unur

Global symbol "$file" requires explicit package name at
blib/lib/HTTP/Client.pm line 44.

The problem seems to be caused by

sub get {
my $self = shift;
my $uri = shift;
....

unless (-e $file) {
open(FILE, ">$file");
print FILE $http->body;
} else {
carp "Won't overwrite existing $file!";
}
}

According to

http://search.cpan.org/~linc/HTTP-Client-1.51/lib/HTTP/Client.pm

the get method is documented to take only the URI as an argument, and
there no mentioned in the docs of writing anything to a file. While one
could get rid of the offending segment, I personally would switch to
LWP: http://search.cpan.org/~gaas/libwww-perl-5.803/

Sinan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top