From: Roland G. <RGi...@a1...> - 2001-10-30 15:13:35
|
> I'm trying to write a Perl script that will record user input to a > program to allow that input to be "played" back and fed into the > program multiple > times. I'm sure I can do this with Expect, but I'm dropping my clue > somewhere along the way. I've tried a number of combinations like: There is a utility for Tcl/Expect called 'autoexpect' that does this, maybe you should just port that to perl. The problem with this task is that you have to determine what the program prompt looks like so you know when to send the next command. This often means that you have to put the script together by hand, so you also could just log the session to a logfile and do that by hand, pasting the appropriate strings into some send/expect template. > Any pointers of where I'm going wrong would be greatly appreciated! Your code looks good in principle and should work. Have you tried setting $Expect::Exp_Internal = 1 to see what Expect is doing internally? $Expect::Debug could also be of help... Hope this helps, Roland -- RGi...@cp... |