I'm working on the beginings of a portion of some perl code that is to telnet into a node using telnet. This snippet of code works fine telnetting into a linux box, but doesn't work logging into my node. Here is what my code looks like.
use strict;
use Net::Telnet ();
my $t = new Net::Telnet Timeout => 30,
Prompt => '/[\$#%:><] $/';
$t->open($ARGV[0]);
$t->login($ARGV[1], $ARGV[2]);
my @lines = $t->cmd("MY CMD/;");
print @lines;
and this is what the login looks like. I'm thinking it's all the white space between the Escape character message and the actual login prompt, but i don't know how to account for that.
Trying 1.1.1.1...
Connected to 1.1.1.1.
Escape character is '^]'.
ENTER USERNAME <
ENTER PASSWORD <