use IO::Socket; use IO::Select; use Time::HiRes; use strict; for (1..500) { my $socket = IO::Socket::INET->new("localhost:12002") or die "no socket"; print $socket "this is a test 123\n"; print $socket "this is a test 456\n"; Time::HiRes::sleep(.5); $socket->close() or die "error closing"; }