Problem Installing HTTP::Client

Discussion in 'Perl Misc' started by Xzanron, Oct 19, 2005.

  1. Xzanron

    Xzanron Guest

    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
    Xzanron, Oct 19, 2005
    #1
    1. Advertising

  2. "Xzanron" <> wrote in news:1129719012.739834.282940
    @g14g2000cwa.googlegroups.com:

    > 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
    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, Oct 19, 2005
    #2
    1. Advertising

  3. Xzanron

    Paul Lalli Guest

    Xzanron wrote:
    > 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.


    You're not alone:
    http://testers.cpan.org/show/HTTP-Client.html#HTTP-Client-1.51

    Apparently the author made a goof in his/her latest version. I would
    suggest using a more commonly used module for HTTP Clients, such as LWP
    or LWP::Simple

    Paul Lalli
    Paul Lalli, Oct 19, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jiong Feng
    Replies:
    0
    Views:
    813
    Jiong Feng
    Nov 19, 2003
  2. Paul Glavich [MVP - ASP.NET]
    Replies:
    0
    Views:
    445
    Paul Glavich [MVP - ASP.NET]
    Jun 20, 2004
  3. T. Regan
    Replies:
    3
    Views:
    707
    T. Regan
    Jun 21, 2004
  4. NNTP
    Replies:
    2
    Views:
    980
    =?Utf-8?B?S2V2aW4gVG9kZA==?=
    Mar 18, 2005
  5. Yannick Turgeon
    Replies:
    2
    Views:
    261
    Yannick Turgeon
    Aug 24, 2005
Loading...

Share This Page