print "Content-type:text/html\n\n"; use LWP::UserAgent; my $ua = LWP::UserAgent->new; $ua->timeout(10); $ua->protocols_allowed( [ 'http','https'],'http://surfproxy.prox:8080'); #$ua->protocols_allowed( [ 'http','https'],'http://surfproxy.prox:8080'); #$ua->env_proxy; my $response = $ua->get('http://search.cpan.org/'); if ($response->is_success) { print $response->content; # or whatever } else { die $response->status_line; }