use IO::Socket::INET; use warnings; use strict; print "started\n"; my $c = IO::Socket::INET->new(Proto => "tcp", PeerAddr => "localhost", PeerPort => 1234); print "connected\n"; my $msg; while (1) { $c->recv($msg, 1024); print time() . " one loop\n"; }