use strict; use warnings; use IO::Socket::INET; use IO::Select; my $connection = IO::Socket::INET->new(PeerAddr => "localhost", PeerPort => 3000, Proto => "tcp"); for (1 .. 100) { print $connection "$_\n"; sleep(1); }