|P is for Practical
Expect.pm Helpby PrimeLord (Pilgrim)
|on Aug 08, 2002 at 19:49 UTC
PrimeLord has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to learn how to use Expect in my perl scripts and I am doing a very poor job of it so far. I am hoping I can get some help from the monks. I have written two very basic programs just to see if I can figure out how this works and I guess I am just not getting it.
Here is the first program Expect_Test
Like I said a very simple script that just calls another script namer. Here are the contents of the namer script.
So I would expect when I run Expect_Test for it to spawn namer and pass it PrimeLord when it sees What is your name. However what happens is namer is called. I see PrimeLord printed to STDOUT. Then I see What is your name: printed to the screen and then the program just exits. I thought maybe I was printing the answer to my expect too soon, but even when I move it after the expect line it didn't work. This seems like it should be very simple, but I just can't get it. Any help would be very appreciated. Thanks!