use IO::Socket; use IO::Pipe; my $machine_addr = 'sb002562'; $sock = new IO::Socket::INET(PeerAddr=>$machine_addr, PeerPort=>1200, Proto=>'tcp', ); die "Could not connect: $!" unless $sock; $id = shift; foreach (1 .. 10) { print $sock "From $id: Msg $_: How are you?\n"; } close ($sock);