in reply to Why won't this read?

Are you sure the server is sending the correct data to the client? What happens when you run:
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;
If that prints out "HTTP/1.1 200 OK" then there is probably a problem with the server and not the client.

Replies are listed 'Best First'.
Re: Re: Why won't this read?
by Anonymous Monk on May 23, 2001 at 01:56 UTC
    Ooops, a pair of +'s in there were copied from the red line wraps in the original message. Fortunately they don't affect the code.
Re: Re: Why won't this read?
by dynamopsychism (Initiate) on May 23, 2001 at 02:27 UTC
    The server responds independently of the client. I can make the server spit stuff out at will, and I'm snooping it over a serial device at the wire level, so I know the server is doing its business. It's still not reading. Any ideas?