Net::HTTP provides lower level access with less processing. Since it is a subclass of IO::Socket::INET you can read directly from the object after making the request.
use Net::HTTP;
# Make the request using Net::HTTP.
my $s = Net::HTTP->new(Host => "www.perl.com") || die $@;
$s->write_request(GET => "/", 'User-Agent' => "Mozilla/5.0");
# Read the raw headers.
my @headers;
while(my $line = <$s>) {
# Headers are done on a blank line.
last unless $line =~ /\S/;
push @headers, $line;
}
print @headers;