kodo has asked for the wisdom of the Perl Monks concerning the following question:
but I don't think this is a good way, so I've usedwhile (1) { $socket->recv($data, 1024); print $data; last if $data eq ''; }
So what's the savest/best way to read from sockets and why? Thanks for any answers/links in advantage who could help me to understand this a bit more.while (read($socket, $data, 1024)) { print $data; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IO::Socket::INET what to use to read/write from socket?
by {NULE} (Hermit) on May 29, 2002 at 15:54 UTC | |
|
Re: IO::Socket::INET what to use to read/write from socket?
by choocroot (Friar) on May 29, 2002 at 11:39 UTC | |
by Joost (Canon) on May 29, 2002 at 13:08 UTC |