perl expect question: user interaction mid script

M

MarkD

In regular (tcl) expect the following code waits for the user to enter
a password followed by enter and then returns to the script:

expect "Password:"
#ask user for password and then return to script
interact -nobuffer -re "(.*)\r" return

I am having problems writing this in perl expect. I used the
following:

$session->expect(60, -re, "Password:");
$session->interact(\*STDIN, "\r");

... but this does not seem to work. I just get another login request
like the inputted password is not going to the telnet login. Am I
missing something? Can anyone offer any suggestions?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top