use IO::Socket; if ($#ARGV != 0) { die "usage: perl $0 [hostname]\n"; } else { $host = $ARGV[0]; } $socket = IO::Socket::INET->new( Proto => "tcp", PeerAddr => $host, PeerPort => 80,) or die $!; $socket->autoflush(1); print $socket "HEAD / HTTP/1.0\015\012\015\012"; while (<$socket>) { if (/^Set-Cookie:/) {print} if (/^Server:/) {print} if (/^P3P:/) {print} if (/^Last-Modified:/) {print} if (/^ETag:/) {print} if (/^X-Powered-By:/) {print} if (/^HTTP/) {print} if (/^Accept-Ranges:/) {print} if (/^Date:/) {print} if (/^Expires:/) {print} if (/^Cache-control:/) {print} if (/^Content-Type:/) {print} if (/^Location:/) {print} if (/^Content-Location:/) {print} if (/^X-Pad:/) {print} if (/^Connection:/) {print} if (/^MIME-Version:/) {print} if (/^Pragma:/) {print} if (/^Vary:/) {print} if (/^TCN:/) {print} if (/^Content-Language:/) {print} if (/^PICS-Label:/) {print} } close $socket;