use strict; use warnings; use LWP::UserAgent; my $url = "http://www.cpan.org/"; my $ua = LWP::UserAgent->new(); my $response = $ua->head($url); # or "get", etc. print($response->as_string());