I'm using perl and p5-Expect in 8.2-Release.
If I change the sending of password to below, the sends fails.
Given this log in sequence looks identical to every FAQ I've seen via Google, I'm curious what I screwed up?
I'm using perl-5.12.3, p5-Expect-1.21, p5-IO-Stty-0.03. Is there a different port I should use vs p5-Expect these days?
Code:
#!/usr/bin/perl -w
my $command = "ssh -l $user $router
use Expect;
my $exp = new Expect;
$exp->raw_pty(1);
$exp->spawn($command) or die "Cannot spawn $command: $!\n";
$exp->expect(15, "assword:");
$exp->send("$password\n");
#
# NOTHING happens above. But when I added this bogus line, the password
# finally is sent. The rest of the script isn't of much use though
#
exp->expect(1, "Bogus, just time out");
[rest of script]
If I change the sending of password to below, the sends fails.
Code:
$exp->send("$password\n") or die "sending of password failed: $!\n";
Given this log in sequence looks identical to every FAQ I've seen via Google, I'm curious what I screwed up?
I'm using perl-5.12.3, p5-Expect-1.21, p5-IO-Stty-0.03. Is there a different port I should use vs p5-Expect these days?