in reply to Re^2: LWP Slow Get
in thread LWP Slow Get
#!/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;
|
|---|