|
With this code:
use Expect;
my $exp = Expect->spawn('tn', 'pansy');
#$exp->debug(1);
my $match = $exp->expect(undef, 'Username:');
if ($match) {
$exp->send('joeshmoe@hoedown.com' . "\n");
print "AFTER OUTPUT = " . $exp->after() . "\n";
}
$exp->soft_close();
and this input:
# tn pansy
Trying...
Connected to pansy.geo.company.com.
Escape character is '^T'.
XXX Firewall: Enter Your Intranet Credentials. Do Not Attempt To Authenticate Using FTP
Username: blah
Password:
Shouldn't $exp->after() equal the string "Passord:" ?
|