#!/usr/local/bin/perl

print "@ARGV \n";

# for chriso

# MGTM 19990426

use strict;

use Net::Telnet;

my $hostname = 'rowan.ripe.net';

my $t = Net::Telnet->new(
	Timeout => 100,			# time, erm, out
	Prompt  => '/whois\sR.I.P.\>\s/',	# server's command prompr
	Host    => $hostname,		# erm, host
	Port	=> 3333,		# and port
	);

# $t->login( $username, $password);	# no need

# my ( @QueryOutput ) = $t->cmd("whois PET10-RIPE"); # your command
my ( @QueryOutput ) = $t->cmd(@ARGV); # your command

# and anything else you want to do

my ( @Output ) = $t->cmd("quit");	# done

# show what we got
print "response:\n " . join ( ' ', @Output ) . "\n";

$t->close;	# really done

# done
exit(0);
