Jan 20, 2010, 3:56 PM
Post #9 of 14
Re: [shawnhcorey] `STRING` - no output for non exiting command
[In reply to]
1) Now that I think about it, to kill() a process you need the process id, which open() does not return. However, reading the IPC docs, they seem to suggest that there is a way to kill a process opened with a pipe:
You might notice that you could use backticks for much the same effect as opening a pipe for reading:
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.
How would that work?
2) Is IPC::Open2 essentially a fork() and an exec() in the child?
(This post was edited by 7stud on Jan 20, 2010, 4:01 PM)