Re: Non-blocking child process

2006-10-19 Thread Dr.Ruud
Jeff Pang schreef: > for (my $i=0;$i<2;++$i) { Alternative: for my $i (0 .. 1) { > my $pid = open CHILD,"|-"; One should always check the return value of open(). > select CHILD;$|++;select STDOUT; Alternative: select((select(CHILD),$|=1)[0]); (from perldoc -q flush) --

Re: Non-blocking child process

2006-10-19 Thread Tom Phoenix
On 10/19/06, Helliwell, Kim <[EMAIL PROTECTED]> wrote: I would like the parent to continue independently of the child. It sounds as if you want to use the double-fork trick. The first fork produces a child process; this child forks a grandchild process, then quits. The grandchild process does

RE: Non-blocking child process

2006-10-19 Thread Helliwell, Kim
-Original Message- From: Jeff Pang [mailto:[EMAIL PROTECTED] Sent: Thursday, October 19, 2006 2:10 AM To: Helliwell, Kim; beginners@perl.org Subject: Re: Non-blocking child process Hello, I changed your codes like below: use strict; for (my $i=0;$i<2;++$i) {

Re: Non-blocking child process

2006-10-19 Thread Jeff Pang
>I'm not even sure the title is the appropriate terminology. What I am >trying to do is fork a process that receives data from the parent, but, >once the data is received, the parent can go on and do whatever it wants >(and likewise the child). How do I arrange for the child process to be >detach