Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: problem w/ LWP::UserAgent?

by dorianwinterfeld (Acolyte)
on May 30, 2013 at 13:43 UTC ( [id://1036050]=note: print w/replies, xml ) Need Help??


in reply to Re: problem w/ LWP::UserAgent?
in thread problem w/ LWP::UserAgent?

Thanks for your quick reply Derby. The script does use LWP::UserAgent. Here is my stripped down test script:
use CGI qw/:standard/; use CGI::Carp (fatalsToBrowser); require LWP::UserAgent; print header; my $ua = LWP::UserAgent->new; my $url = 'http://google.com'; my $response = $ua->get($url); if ($response->is_success) { print $response->decoded_content; # or whatever } else { die "failed: $url : ", $response->status_line; }
So, it's dying w/ Status code 500. The server logs don't say much: "GET /scripts/prince/lwp_test.plx - 200 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.1;+WOW64;+Trident/6.0;+EIE10;ENUSWOL)" I have run this script on two different servers, after the Perl upgrade on both, and I get the same error message.

Replies are listed 'Best First'.
Re^3: problem w/ LWP::UserAgent?
by derby (Abbot) on May 30, 2013 at 14:33 UTC

    Is it really throwing the error with the google url or was that just a change for posting? What happens if you run the above script from the command line? Do you still get the 500? The 500 error *should* be from the server the url points to and I have a hard time believing google is throwing a 500.

    The only *recent* LWP upgrade issue that I can think of is the SSL validity check on https -- but that would throw an entirely different error I believe.

    -derby
      The only *recent* LWP upgrade issue that I can think of is the SSL validity check on https
      After this (after 6.x) there were updates related to socket stuff.
Re^3: problem w/ LWP::UserAgent?
by vsespb (Chaplain) on May 30, 2013 at 15:48 UTC
    Could you run it with
    print $response->dump;
    (in case of failure) and paste output here?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1036050]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-04-25 14:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found