#!/usr/bin/perl use Data::Dumper; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $response = $ua->get('http://search.cpan.org/'); if ($response->is_success) { print $response->decoded_content; } else { print $response->status_line; } print Dumper $response; #### $VAR1 = bless( { '_content' => 'Can\'t connect to search.cpan.org:80 (Permission denied) LWP::Protocol::http::Socket: connect: Permission denied at /usr/lib/perl5/5.8.8/CGI/Carp.pm line 314.', '_rc' => 500, '_headers' => bless( { 'client-warning' => 'Internal response', 'client-date' => 'Mon, 13 Feb 2012 19:44:22 GMT', 'content-type' => 'text/plain' }, 'HTTP::Headers' ), '_msg' => 'Can\'t connect to search.cpan.org:80 (Permission denied)', '_request' => bless( { '_content' => '', '_uri' => bless( do{\(my $o = 'http://search.cpan.org/')}, 'URI::http' ), '_headers' => bless( { 'user-agent' => 'libwww-perl/6.03' }, 'HTTP::Headers' ), '_method' => 'GET' }, 'HTTP::Request' ) }, 'HTTP::Response' );