Rex::Helper::SSH2::Expect - An Expect like module for Net::SSH2
=head1 DESCRIPTION
This is a module to have expect like features for Net::SSH2. This is the first version of this module. Please report bugs at GitHub L<https://github.com/krimdomu/net-ssh2-expect>
=head1 DEPENDENCIES
=over 4
=item *
L<Net::SSH2>
=back
=head1 SYNOPSIS
use Rex::Helper::SSH2::Expect;
my $exp = Rex::Helper::SSH2::Expect->new($ssh2);
$exp->spawn("passwd");
$exp->expect($timeout, [
qr/Enter new UNIX password:/ => sub {
my ($exp, $line) = @_;
$exp->send($new_password);
}
],
[
qr/Retype new UNIX password:/ => sub {
my ($exp, $line) = @_;
$exp->send($new_password);
}
],
[
qr/passwd: password updated successfully/ => sub {