No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This is what Expect is for.
The Expect module handles the pseudo-tty details,
so you don't have to!
This program is called 'consumer.pl'. I added a clue for Expect to use to find the end of the output. You can do without the ending markers, you just have to be a little more clever with Expect. This sample program is similar to yours, in that it uses multiple input streams. It writes a file for each stream. Here is a program to communicate with it, and send it two streams of data. The Expect module sends control-D with the string "\cD". I'm sure that this code could be better, it is intended as proof of concept. I have only used Expect a few times. I find it difficult but worthwhile. minor update: pushed the code around a bit
It should work perfectly the first time! - toma
In reply to Re: what is EOF and how can I send it?
by toma
|
|