#!/usr/bin/env perl use IO::Socket; use strict; my $socket = new IO::Socket::INET ( PeerAddr => $_, PeerPort => '7071', Proto => 'tcp', ); die "Coudn't open socket" unless $socket; $socket->autoflush(1); my $dir = "/tmp"; print $socket "ls:$dir\n"; close($socket);