aka1 has asked for the wisdom of the Perl Monks concerning the following question:
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Non-blocking Pipes?
by Celada (Monk) on Dec 30, 2005 at 05:43 UTC | |
|
Re: Non-blocking Pipes?
by sgifford (Prior) on Dec 30, 2005 at 06:39 UTC | |
|
Re: Non-blocking Pipes?
by gloryhack (Deacon) on Dec 30, 2005 at 05:36 UTC | |
by aka1 (Novice) on Dec 30, 2005 at 20:42 UTC | |
|
Re: Non-blocking Pipes?
by pileofrogs (Priest) on Dec 30, 2005 at 17:12 UTC | |
|
Re: Non-blocking Pipes?
by Mr_Person (Hermit) on Dec 30, 2005 at 17:52 UTC | |
by aka1 (Novice) on Dec 30, 2005 at 20:53 UTC |