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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top