Hi monks.
I have an in-house application that will not exit after running. The only way I've been able to have my script continue with the data it's been given is to open it up with IPC::Open2 (I believe this was recommended to me quite some time ago, after posting my specific problems).
The issue now is that no matter how much I sleep before issuing my "quit" command to the writer, I only get about half of what I want. I assume this has something to do w/ the way Open2 forks, but that's just a hunch.
An ugly example:
my $pid = open2(*HIS_OUT, *HIS_IN, "/my/application" ) || die $!;
sleep 3;
print HIS_IN "quit\n";
while ( <HIS_OUT> ) {
chomp;
&do_something_to($_);
}
Even if I sleep for 15, I still only get about half of the full output. If I don't issue the quit command, I get all the output, but of course, my script is stuck, as it will never leave the HIS_OUT loop.