in reply to Why won't this read?
If that prints out "HTTP/1.1 200 OK" then there is probably a problem with the server and not the client.use strict; use IO::Socket::INET; my $remote_host = "www.perlmonks.org"; my $remote_port = 80; my $socket; $socket = IO::Socket::INET->new(PeerAddr => $remote_host, PeerPort => +$remote_port, Type => SOCK_STREAM, Proto => "tcp") || die "Problem: $ +! +\n"; print $socket "GET / HTTP/1.0\r\n\r\n"; my $data = <$socket>; print STDOUT $data; close $socket;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Why won't this read?
by Anonymous Monk on May 23, 2001 at 01:56 UTC | |
|
Re: Re: Why won't this read?
by dynamopsychism (Initiate) on May 23, 2001 at 02:27 UTC |