Take a look at LWP, along with the associated HTTP::Request, HTTP::Response, and HTTP::Headers object
use LWP;
use HTTP::Request;
my $ua = LWP::UserAgent->new();
my $request = HTTP::Request->new( GET => 'http://www.google.com' );
my $response = $ua->request( $request );
my $headers = $response->headers();
print $headers->header( 'Content-Length');
|