Altiokis has asked for the wisdom of the Perl Monks concerning the following question:
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.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;
Trying 1.1.1.1... Connected to 1.1.1.1. Escape character is '^]'. ENTER USERNAME < ENTER PASSWORD <
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: using NET::TELNET waiting for login prompt
by Illuminatus (Curate) on Aug 15, 2012 at 23:34 UTC | |
by Altiokis (Initiate) on Aug 15, 2012 at 23:49 UTC | |
by Illuminatus (Curate) on Aug 16, 2012 at 00:47 UTC |