LWP connect failing - bad hostname

Ask a Question related to PERL Modules, Design and Development.

  1. #1

    Default LWP connect failing - bad hostname

    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:

    #!/usr/bin/perl
    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 [url]www.linpro.no:80[/url]
    (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.


    Thanks,
    Clifford


    Clifford Snow Guest

  2. Similar Questions and Discussions

    1. MySQL driver failing to connect
      I was using the MySQL driver 3.51 to upload an ACCESS table to a MySQL table on my host. Then I world read the table with ColdFusion MX. Evreything...
    2. failing to connect to MySQL
      WinXP Pro CFMX 6.1(using built in webserver) MySQL 4.1.13a-nt via TCP/IP Okay, I have tried connecting to my DB following the instructions at...
    3. hostname
      Is there away to find all of the hostname on a lan with use of perl? Thanks, Thomas
    4. hostname for LWP
      Hi - I just installed perl-5.8.0 from source, in the shell (perl -MCPAN -e shell) I tried to "install LWP" but had some problems until I added...
    5. Sendmail 8.9.3 - need to remove hostname from @hostname.domain.com
      I just upgraded from 432 to 433. Along with this came Sendmail8.9.3. I have changed the new sendmail.cf file with the same changes as the previous...
  3. #2

    Default Re: LWP connect failing - bad hostname -FIXED

    On Wed, 07 Jun 2006 09:28:15 -0700, Clifford Snow wrote:
    > 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:
    >
    > #!/usr/bin/perl
    > 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 [url]www.linpro.no:80[/url]
    > (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.
    >
    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.

    Clifford
    Clifford Snow Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139