perl expect question: user interaction mid script

Discussion in 'Perl' started by MarkD, Dec 4, 2003.

  1. MarkD

    MarkD Guest

    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?
    MarkD, Dec 4, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Simon Strandgaard

    how to expect eof with expect+pty

    Simon Strandgaard, Dec 20, 2006, in forum: Ruby
    Replies:
    4
    Views:
    353
    Simon Strandgaard
    Dec 20, 2006
  2. Replies:
    4
    Views:
    266
    Randy Webb
    Dec 14, 2004
  3. ruud

    Perl::expect script error

    ruud, Jan 19, 2005, in forum: Perl Misc
    Replies:
    2
    Views:
    213
  4. Phil
    Replies:
    0
    Views:
    167
  5. Eric

    Perl interaction with Expect

    Eric, Feb 14, 2007, in forum: Perl Misc
    Replies:
    5
    Views:
    830
Loading...

Share This Page