my $head_request = HTTP::Request->new(HEAD => $url); my $head_response = $agent->request($head_request); ... my $response = $agent->get($url);