$OUTPUT_AUTOFLUSH=1; my $socket = new IO::Socket::INET (PeerHost => 'my.domain.net', PeerPort => '8888', Proto => 'tcp', Reuse => 1); die "cannot connect to the server $!\n" unless $socket; while (1) { print "Command??? "; chomp ($cmd = <>); # data to send to a server $socket->send($cmd); # wait for server acknowledgement ### GET REPLY $socket->recv($ack, 1024); ### GET REPLY print "response from server was $ack\n"; ### GET REPLY } $socket->close();