Problem with LWP::USERAGENT

C

Chandra

Hello gurus,
I am using LWP::Useragent perl module to get a url from the
www.
Code snippet:

#!perl -w

use LWP::UserAgent;
LWP::Debug::level('+');
$ua = new LWP::UserAgent || die "$!";
$ua->proxy(['http', 'ftp'] => 'http://server/proxyname');

$req = new HTTP::Request 'GET',"http://www.perl.com/" || die "$!";
$ua->agent('Mozilla/4.03');
$req->proxy_authorization_basic("username", "password");
$res = $ua->request($req) || die "$!";
if ($res->is_success)
{ print $res->content }
else
{ print $res->error_as_HTML }


This seems to work indifferently . Becuase every time i run this it
print a page with my proxy server name etc.

RESULT:
<HTML>
<HEAD>
<TITLE>internetgateway on servername</TITLE>
</HEAD>
<BODY>

<CENTER>
iPlanet 6.04 "internetgateway" instance on machinename
</CENTER>

</BODY>
</HTML>


Can any body please help me with this .
Thanks in advance
-Shekhar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,710
Latest member
bernietqt

Latest Threads

Top