#!/usr/bin/perl -w

use strict;
use IO::Socket;

my $remote = IO::Socket::INET->new(Proto     => "tcp",
                                   PeerAddr  => "localhost",
                                   PeerPort  => 9000);

die "cannot connect to server" unless $remote;

$remote->autoflush(1);

my $cmd = $ARGV[0] || die "usage $0 cmd";

print $remote "$cmd\n";

my $value = <$remote>;
close $remote;

print "==>$value<==\n";
