in reply to Re^3: waitpid stalling on one particular file
in thread waitpid stalling on one particular file
Oh, I hadn't thought of that, my slightly extended code was:
$pid=open3($wtr, '>&reader', $err, $cmd); waitpid($pid, 0); my %Results=(); while(<$rdr>){ chomp; @temp=split(/\t/); if(!exists($Results{$temp[0]}) || $Results{$temp[0]}<$temp[10] +){ $Results{$temp[0]}=$temp[10]; } }
So I take it that I should've used waitpid after I finished "reading" the pipe. Duh(!) Moving waitpid til after <$rdr> worked. Upon reflection, I realized that the output from running this particular file was far larger than any other, and was thus the first to fill the I/O buffer.
In related news, I gave myself a crash course in buffering and also tried using IPC::Run() with pty, and worked too, but which is recommended?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: waitpid stalling on one particular file
by salva (Canon) on Sep 25, 2014 at 19:41 UTC |