#!/usr/bin/perl -w

use strict;
use Net::Telnet;

@ARGV > 1 or die <<"USAGE";
$0 <host> <port>

test connection on <port> against <host>.
USAGE

my ($t, $h) = (new Net::Telnet (Telnetmode => 0), shift);
$t->open(Host => $h, Port => shift) and printf "%s => %s", $h, $t->getline;

=head1 NAME

B<testport.pl> <host> <port>

=head1 DESCRIPTION

Test connection on <port> against <host>.

=head1 COPYRIGHT

Copyright 2010 Etienne LEMEE <coding AT etilem DOT net>

This piece of code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

=cut

