During a Net::Telnet login, after entering a password, the code looks
for a command prompt for a successful login, or a username/password
prompt in case of authentication error.
Net::Appliance::Session::Transport::Telnet just looks for a command
prompt so that in the event of an authentication error, you get a
timeout, which is not very desirable.
To fix this, in
Net::Appliance::Session::Transport::Telnet::_connect_core(), replace
$self->waitfor($self->prompt)
or $self->error('Login failed to remote host');
with
(undef, $match) = $self->waitfor(Match => $self->prompt, Match =>
$self->pb->fetch('userpass_prompt'))
or $self->error('Login failed to remote host');
if ($match =~ eval 'qr'. $self->pb->fetch('userpass_prompt')) {
$self->error('Authentication failed to remote host');
}
and move the 'my $match;' statement out of the preceding 'if
($self->do_login) {}' block so that it is in effect for the whole
subroutine.