common has asked for the wisdom of the Perl Monks concerning the following question:
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: checking output for text
by Zaxo (Archbishop) on Oct 09, 2002 at 00:41 UTC | |
by Anonymous Monk on Oct 09, 2002 at 04:25 UTC | |
|
Re: checking output for text
by chromatic (Archbishop) on Oct 09, 2002 at 00:45 UTC | |
|
Re: checking output for text
by foxops (Monk) on Oct 09, 2002 at 00:47 UTC | |
|
Re: checking output for text
by Enlil (Parson) on Oct 09, 2002 at 01:00 UTC | |
|
Re: checking output for text
by io (Scribe) on Oct 09, 2002 at 07:14 UTC |