I am trying to avoid net::telnet::cisco, as it doesn't give
all the features, and had much more luck with the net::telnet.
Anything wrong in the following format? -
# authentication
if ($telnet->waitfor('/Username: $/i'))
{
$telnet->print($username);
}
elsif ($telnet->waitfor('/Password: $/i'))
{
$telnet->print($password);
}
# Wait for the prompt, send "enable" and enable-pwd
elsif ($telnet->waitfor('/>/'))
{
$telnet->print('enable');
$telnet->waitfor('/Password: $/i');
$telnet->print($enpwd);
}
else
{
$telnet->waitfor('/>/');
$telnet->print('enable');
$telnet->waitfor('/Password: $/i');
$telnet->print($enpwd);
}
It doesn't like the format. But individually works just fine.....