in reply to Expect question
$before is what came before the match, $match is what it matched on (useful if you passed in more than one match candidate), and $after is what came after the match. Note that $before and $after are strings and they may contain newlines.print $expect_instance "$username}\r"; ( $which, $why, $match, $before, $after) = $expect_instance->expect( $ +timeout, 'Password:'); if( ! $which ) { myerror( 'send the password:'.$why );
I think you are getting hung up on the spaces when either they do not matter or you could just deal with them later on in your perl code. Though it's been a few years since I touched Expect.pm so maybe it is more rigid than before.
|
|---|