H
Hemant Kumar
I want to start a DOS program from perl, read its output and give it
further input when the program prompts (based on output of the
program).
Suppose the DOS program is as follows
#include <stdio.h>
void main() {
int choice;
srand();
do {
printf ("\n%d\n", rand());
printf ("Do you want to do more ?\n");
choice = getchar();
} while ( choice != 'n');
printf("\nGoodbye\n");
}
I want the perl script to read the results generated. Based on results
read, give input for getchar. I have tried using system(), Open (this
only allows me to do either input or output but not both). I don't
have the source for the DOS program so need to do both input and
output from Perl.
Can you suggest a way to get around these limitations ?
Thanks a lot,
Hemant
further input when the program prompts (based on output of the
program).
Suppose the DOS program is as follows
#include <stdio.h>
void main() {
int choice;
srand();
do {
printf ("\n%d\n", rand());
printf ("Do you want to do more ?\n");
choice = getchar();
} while ( choice != 'n');
printf("\nGoodbye\n");
}
I want the perl script to read the results generated. Based on results
read, give input for getchar. I have tried using system(), Open (this
only allows me to do either input or output but not both). I don't
have the source for the DOS program so need to do both input and
output from Perl.
Can you suggest a way to get around these limitations ?
Thanks a lot,
Hemant