#!/usr/bin/env perl use strict; use warnings; use IO::Socket; my $client = IO::Socket::INET::->new( Proto => 'tcp', PeerAddr => 'localhost', PeerPort => 55555 ) or die "Client can't connect: $!"; my @msgs = 'A' .. 'Z'; for (@msgs) { print $client "$_\n"; sleep 1; }