using Net::SSH::Perl with Expect

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Hey everyone, got a code snippet here:


use strict;
use Expect;
use Net::SSH::Perl;

my $connection = new Net::SSH::Perl( "",
                                                        { protocol => "2,1",
                                                          use_pty => 1 } );

$connection->login("user", "pwd");

my $exp = Expect->exp_init($connection->sock);

$exp->expect(5, ">");
print "got our prompt....\n";

print "sending exit...\n";

print "done...\n";

I'm trying to get Expect to log all of the transactions with the ssh session
either to the file (as noted) or stdout (as commented).  What it outputs
from any of the expect calls is seemingly encrypted.

Is there a way around this?  I would prefer to use Expect for interacting
with SSH, and it will have to be Net::SSH::Perl as I want the ssh session to
be within the initial process.

thanks for any help/advice,

Site Timeline