... my $content; my $response = $ua->get('http://search.cpan.org/'); if ($response->is_success) { $content = $response->decoded_content; # or whatever } else { warn $response->status_line; } ...