in reply to Re: Problems with LWP
in thread Problems with LWP

This is a version that works for me now. Hope it helps a bit. (I've shamelessly stolen the relevant code from PPM.pm :-)
use strict; use LWP::UserAgent; my $href = "http://kompas.com/kompas-cetak/0505/09/metro/index.htm +"; my $ua = new LWP::UserAgent; my $request = new HTTP::Request ("GET" => $href); $ua->env_proxy, $request->proxy_authorization_basic($ENV{HTTP_proxy_user}, $ENV{HTTP_p +roxy_pass}) if defined $ENV{HTTP_proxy}; my $response = $ua->request($request); if ($response && $response->is_success) { print "Success!\n", $response->content; } else { print "Failed!\n", $response->as_string; }


holli, /regexed monk/

Replies are listed 'Best First'.
Re^3: Problems with LWP
by smocc (Novice) on May 17, 2005 at 14:10 UTC
    Hmm, apparently not.
    Failed! 500 (Internal Server Error) Can't connect to kompas.com:80 (Bad protoc +ol 'tcp') Content-Type: text/plain Client-Date: Tue, 17 May 2005 14:09:43 GMT Client-Warning: Internal response 500 Can't connect to kompas.com:80 (Bad protocol 'tcp')
    "We shall peck them to death tomorrow, my dear."
      to better troubleshoot this you can use a packet trace program (tcpdump, ethereal) to see if and what TCP/IP packets leave your machine.