Hi:
I'm trying to run 2 processes in parallel on suse. The approach I'm
taking is to use open2 as in numerous examples I've found via google.
But, unlike the examples I've found, the parallel process I'm trying to
run with is the execution of another perl script, not a system command.
The test I'm trying to implement has the parallel process simply
increment an integer that's passed to it, then send that value to
STDOUT. Here's the code.....
use IPC::Open2;
$pid = open2(\*RD, \*WR, "perl det.pl") or die "Failed to spawn off the
parallel proc";
print WR "2";
$inc = <RD>;
print "$inc\n";
Th eparallel proc, det.pl, is obsessive about flushing any buffers....
use FileHandle;
top:
$x = <STDIN>;
chomp($x);
if($x eq "exit") {exit;}
$x++;
print STDOUT "$x\n";
flush STDOUT;
goto top;
Debug statements indicate that the "print WR "2" " happens but then it
stalls. Maybe a broken pipe(s) into/out of the spawned proc ???
Any suggestions?
Thanks
-dave