You're right on, Fletch. Check this out. It appears to work, but I have to take a quick capture to verify:
#!/usr/bin/perl -w
use IO::Socket;
unless (@ARGV > 1) { die "usage: $0 host document ..." }
$host = shift(@ARGV);
$get = "GET / HTTP/1.0\n\n";
$remote = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => $host,
PeerPort => "http(80)",
);
unless ($remote) { die "cannot connect to http daemon on $host" }
$remote->autoflush(1);
@lines = split(//,$get);
foreach $singlechar (@lines) {
print $remote $singlechar;
sleep(1);
#while ( <$remote> ) { print }
}
close $remote;
|