I have a program which is calling another program and processing the child's output, ie:
my $pid = open($handle, "$commandPath $options |");
Now I've tried a couple different ways to read from the handle without blocking with little or no success.
I found related questions:
- perl-win32-how-to-do-a-non-blocking-read-of-a-filehandle-from-another-process
- why-does-my-perl-sysread-block-when-reading-from-a-socket
But they suffer from the problems:
ioctl
consistently crashes perlsysread
blocks on 0 bytes (a common occurrence)
I'm not sure how to go about solving this problem.