Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > perl expect question: user interaction mid script

Reply
Thread Tools

perl expect question: user interaction mid script

 
 
MarkD
Guest
Posts: n/a
 
      12-04-2003
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?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
perl expect script for telnet vinayaka gv General Computer Support 0 10-11-2007 12:07 PM
Perl interaction with Expect Eric Perl Misc 5 02-15-2007 06:10 PM
how to expect eof with expect+pty Simon Strandgaard Ruby 4 12-20-2006 04:00 PM
Bug in $obj->expect() ... ? (Expect 1.15) Phil Perl Misc 0 07-07-2006 07:25 AM
Perl Help - Windows Perl script accessing a Unix perl Script dpackwood Perl 3 09-30-2003 02:56 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57