LWP connect failing - bad hostname

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have two different scripts that use the LWP module that stopped
working yesterday, June 6.  I ran the following script to verify that
the problem was the LWP module:

  use LWP::UserAgent;
  $ua = LWP::UserAgent->new;

  $req = HTTP::Request->new(GET => 'http://www.linpro.no/lwp ');
 $res = $ua->request($req);

  # check the outcome
  if ($res->is_success) {
     print $res->content;
  } else {
     print "Error: " . $res->status_line . "\n";

The error message returned is
"Error: 500 Can't connect to www.linpro.no:80
    (Bad hostname 'www.linpro.no')"

I verified that I can connect to the site using firefox and ping
so I believe that dns is working properly.  

I'm running perl v5.8.5 and libwww-perl-5.805.

The only thing that changed on my system was the updating of mozilla,
firefox, xorg and squiremail.


Re: LWP connect failing - bad hostname -FIXED

On Wed, 07 Jun 2006 09:28:15 -0700, Clifford Snow wrote:

Quoted text here. Click to load it
Found the problem - it was a corrupted /etc/hosts file that I had modified
yesterday.  Strange how it screwed up LWP but everything else worked fine.

I'm posting this just in case someone else has similar problems.


Site Timeline