Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

connecting to an external site using perl via proxy server

Status
Not open for further replies.

IMAUser

Technical User
May 28, 2003
121
CH
#!/sbcimp/run/pd/perl/5.6.1/bin/perl

use lib '/sbcimp/run/pd/cpan/5.6.1-2001.06/lib';

use LWP;
use HTTP::Request;
use URI;

$ua = LWP::UserAgent->new;
$ua->proxy('http' => '
$req = HTTP::Request->new('GET','$req->proxy_authorization_basic('my_username', 'my_password');

$res = $ua->request($req);

print $res->content if $res->is_success;


How can I see if that script runs successfully or fails. And if it fails , how can I find if the error is at the proxy level or somewhere else.

TIA
 
You can use eval { }print $@; --> to check for errors || chk ur server log.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top