vancetech has asked for the wisdom of the Perl Monks concerning the following question:
use strict; use IO::Socket; $|++; my( $host, $port, $kidpid, $handle, $line ); ( $host, $port ) = @ARGV; my $msg = qq{HEAD / HTTP/1.0\nHOST: $host\n\n}; $handle = IO::Socket::INET->new( Proto => 'tcp', PeerAddr => $host, PeerPort => $port, Blocking => 0) or die("$!"); $handle->autoflush(1); $handle->send( $msg, undef, "test" ); my @results; for( 0..10 ) { last if @results = $handle->getlines; select(undef, undef, undef, .5); } print @results; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Web client programming troubles
by Sioln (Sexton) on Jan 16, 2006 at 11:22 UTC | |
|
Re: Web client programming troubles
by tirwhan (Abbot) on Jan 16, 2006 at 11:02 UTC | |
by northwind (Hermit) on Jan 16, 2006 at 13:02 UTC | |
by vancetech (Beadle) on Jan 16, 2006 at 21:23 UTC | |
|
Re: Web client programming troubles
by dragonchild (Archbishop) on Jan 16, 2006 at 15:41 UTC |