in reply to Fetching HTML Pages with Sockets
That code works for me without any warnings, although it would hang until I called flush(SOCK) after the print, where flush is defined as
sub flush { select($_[0]); my $t=$|; $|=1; $|=$t; }.
All of the functions you called above return undef on error, and set $! to an error number and "$!" to an error message. Why don't you check for errors?
btw, LWP comes with perl. You probably should be using that. For starters, it knows that "\r\n" will not always do what you want. Use "\xD\xA" instead of "\r\n". Also, should do local *SOCK to limit the scope of SOCK.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Fetching HTML Pages with Sockets
by amt (Monk) on Sep 19, 2004 at 19:23 UTC | |
by ikegami (Patriarch) on Sep 19, 2004 at 19:42 UTC | |
by amt (Monk) on Sep 19, 2004 at 19:57 UTC | |
by amt (Monk) on Sep 19, 2004 at 20:10 UTC | |
by ikegami (Patriarch) on Sep 19, 2004 at 20:51 UTC |