#!/usr/bin/perl -w

use IO::Socket::INET;
use IO::Select;

$| = 1; 

if ($#ARGV<0) {  print "n4ctl.pl: a command must be given!\n"; exit(-1); }

my $sock = new IO::Socket::INET(PeerAddr => 'localhost', PeerPort => 20003, Proto => 'udp', Timeout => 1) or die('could not connect.');

$data = join (" ", @ARGV);
print $sock $data;

@ready = IO::Select->new($sock)->can_read(3);
if (@ready) {
    $sock->recv($datagram, 16384);
    }
print "$datagram\n"; 
  

