This isn't a technical question so much as a request for opinions. Yesterday I had reason to have perl parse the output of a long running process that only produced occasional output. It seemed to me the best way to go about this was to read from a pipe in a non-blocking fashion, but how to do this (or even if it is possible) without actually setting up the "reader" as a separate process communicating via IPC (e.g. sockets) is non-obvious.
I ended up redesigning my process to take advantage of blocking, but the question still remains an intriguing one. Does anyone out there in the pews have any ideas on simple non-blocking pipes or command execution in general? I am very used to --full-- IPC but I'm looking for something lighter. I am looking for something more akin to how you can open a "normal" filehandle with a O_NONBLOCK flag or a more straightforward way to apply the select() function to pipes.
Thoughts?
In reply to Non-blocking Pipes? by aka1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |