lynx has asked for the wisdom of the Perl Monks concerning the following question:
When I start the script it starts the program and, but does not output anything. Only when I kill the process of the external program through the windows task manager, the (correct) output is printed to the screen. Do I somehow have to end the process in the script? When I run the program just from the command line with input on standard input, it prints it's results and exits.use IPC::Open2; my $infile = shift; open (INFILE, "<$infile"); my $output; my $input; { local $/ = undef; $input = <INFILE>; } my $pid = open2(*README, *WRITEME, 'progam.exe'); print WRITEME "$input"; { local $/ = undef; $output = <README>; } close(README); close(WRITEME); waitpid($pid, 0); print "$output";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: IPC:Open2 question
by pbeckingham (Parson) on Jul 13, 2004 at 16:45 UTC | |
|
Re: IPC:Open2 question
by holo (Monk) on Jul 13, 2004 at 17:25 UTC | |
by Anonymous Monk on Jul 13, 2004 at 18:15 UTC | |
|
Re: IPC:Open2 question
by keszler (Priest) on Jul 13, 2004 at 17:20 UTC | |
by Anonymous Monk on Jul 13, 2004 at 18:24 UTC | |
by keszler (Priest) on Jul 14, 2004 at 10:43 UTC | |
|
Re: IPC:Open2 question
by zentara (Cardinal) on Jul 14, 2004 at 15:47 UTC |