use warnings; use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $url = 'http://www.google.com'; print $ua->head($url)->as_string;