Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Install of libwww-perl problems

by ARiccela (Novice)
on Jun 08, 2009 at 14:11 UTC ( #769557=perlquestion: print w/replies, xml ) Need Help??
ARiccela has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to install Bundle::LWP via the CPAN shell on a new RH box. All the modules will install via CPAN except libwww-perl-5.826. I am getting the following error (the IP has been changed for obvious reasons):
# perl Makefile.PL Can't connect: IO::Socket::INET: Bad hostname 'http://999.99.999.9:570 +89' Test server timeout The can-we-talk-to-ourself test failed. Writing Makefile for LWP #
I am assuming that is a port number being appended to the IP address considered as a bad hostname. If so, what config file do I need to change to correct this problem? I have edited the /etc/hosts file to include the correct name and IP. The name in /etc/hosts does match the system environment variable HOSTNAME. What am I missing?

Replies are listed 'Best First'.
Re: Install of libwww-perl problems
by almut (Canon) on Jun 08, 2009 at 14:50 UTC

    It's the "http://" prefix that makes it a bad hostname.

    LWP comes with a little script talk-to-ourself which is using Sys::Hostname to determine the hostname of the current system. Apparently something is configured incorrectly... so I would look into Sys::Hostname to figure out why it's returning the hostname with a leading http://.

    You can call it standalone like this:

    $ perl -MSys::Hostname -e'print hostname()."\n"'

    (Update: fixed typo — thanks Anonymous Monk!)

      hostname is a function :)
      perl -MSys::Hostname -le " print hostname "
      @AnonymousMonk - Since I am fairly new to Perl and Linux, I did not feel comfortable proceeding with the install until I knew exactly what was causing the problem. I didn't want to do a 'broken install' and then have to go back and fix something I really don't know how to fix! And thank you for the clarification on 'hostname.' I was assuming it was a Linux system var or Perl var. @Almut - Thank you for the explanaion and a direction to pursue!
        If you are running a Webserver , make your hostname match the ServerName
Re: Install of libwww-perl problems
by Anonymous Monk on Jun 08, 2009 at 14:43 UTC
    That error shouldn't stop CPAN from installing LWP. Try
    install LWP

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://769557]
Approved by marto
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2018-06-23 15:11 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.