in reply to LWP error 500

I suspect that you are behind firewall or proxy, this is network, but not LWP::UserAgent problem.
You may want to try the proxy object method:
... my $ua = LWP::UserAgent->new(); # your proxy ip address instead if '10.0.0.1': $ua->proxy('http', 'http://10.0.0.1:8080'); ...


Replies are listed 'Best First'.
Re^2: LWP error 500
by gargle (Chaplain) on Sep 01, 2005 at 05:33 UTC

    Hi,

    If your proxy asks you for a userid & password you should do the following:

    #!/usr/bin/perl use strict; use warnings; use LWP::UserAgent; my $ua = new LWP::UserAgent; $ua->agent("mYpErLsCrIpT.pl/3.0"); $ua->env_proxy; $ua->proxy(http=>'http://proxy.pxpost:8080'); my $req = new HTTP::Request "GET" => "http://www.slashdot.org"; $req->proxy_authorization_basic('gargle','ImNoTgOnNaTeLl'); print $ua->request($req)->as_string;
    --
    if ( 1 ) { $postman->ring() for (1..2); }
      I prefer setting up the proxy information in the system environment or by modifying %ENV during the script. This provides maximum compatibility for modules like Crypt::SSLeay which would be required for https access but don't pick up the LWP proxy info.