7stud has asked for the wisdom of the Perl Monks concerning the following question:
Dear Monks,
I'm wondering if you can kill a process that you started with a pipe, e.g.:
open $PIPE_READER, "some_command |";
The IPC docs seem to suggest that you can:
You might notice that you could use backticks for much the same effect as opening a pipe for reading:
<snip code>
While this is true on the surface, it's much more efficient to process the file one line or record at a time because then you don't have to read the whole thing into memory at once. It also gives you finer control of the whole process, letting you to kill off the child process early if you'd like.
section: Using open() for IPC
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: pipes: killing the child?
by ikegami (Patriarch) on Jan 21, 2010 at 05:52 UTC | |
by 7stud (Deacon) on Jan 21, 2010 at 10:25 UTC | |
by rubasov (Friar) on Jan 21, 2010 at 11:23 UTC | |
by ikegami (Patriarch) on Jan 21, 2010 at 16:17 UTC | |
by 7stud (Deacon) on Jan 22, 2010 at 08:30 UTC | |
by ikegami (Patriarch) on Jan 22, 2010 at 10:32 UTC | |
by Anonymous Monk on Jan 22, 2010 at 09:05 UTC |