Hi list!

im try-ing this code, to get a multi line server response:

use Socket;
socket(sock, AF_INET, SOCK_STREAM, getprotobyname('tcp')) || die "error: $!\n";
    $dest = sockaddr_in($_[0], inet_aton($_[1]));
    connect(sock, $dest) || die "error: $!\n";
    select(sock);

while ($response=<sock>) {
  print;
}
close (sock) || die "close: $!\n";

The thing is that after it gets the whole response, the script hangs,
and i have to quit using Ctrl+c.

Question:
How can i get the whole server response, that is a multi-lined
response, and to get the script not to hang??

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to