|
From: Greg L. <gl...@ey...> - 2001-10-27 05:45:52
|
Hi all,
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:
# Open an external file to listen on.
open(FOO, ">foo.$$");
select((select(FOO),$|=1)[0]);
my $external = Expect->exp_init(\*FOO);
# Spawn an external command and interact
my $stdin = Expect->exp_init(\*STDIN);
$stdin->set_group($external);
my $expect = Expect->spawn('some program');
$expect->debug(2);
$expect->interact($stdin);
with no success. In the above attempt, the file "foo.$$" is empty.
Any pointers of where I'm going wrong would be greatly appreciated!
--
Greg Lewis Email : gl...@ey...
Eyes Beyond Phone : (801) 765 1887
Information Technology Web : http://www.eyesbeyond.com
|