perl expect question: user interaction mid script

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MarkD

    perl expect question: user interaction mid script

    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(\*STD IN, "\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?
Working...