use constant BUFFER_LENGTH=>0x1000;
my %opts;
-getopts "hH",\%opts or die "getopts()";
+getopts "xhH",\%opts or die "getopts()";
@ARGV==1 && $ARGV[0]=~m#^http://(([^/:]+)(?::(\d+))?)(/.*)$#
or die "Syntax: $0 [-hH] http://hostname/pathname";
my($hostport,$host,$port,$path)=($1,$2,$3,$4);
"Host"=>$hostport,
"X-httpgetdumb"=>'$Id$',
);
+$header{"Accept"}="application/xhtml+xml" if $opts{"x"};
while (my($key,$val)=each(%header)) {
print SOCK "$key: $val\r\n";
}