[ale] Any Perl Gurus Out There?

Christopher Fowler cfowler at outpostsentinel.com
Thu Feb 24 09:24:20 EST 2005


Something like this

$SIG{CHLD} = sub {$CHILD = 1};

while(1) {
  if($CHILD == 1) {
    wait;
    $CHILD = 0;
  }
}
On Thu, 2005-02-24 at 06:43, Jonathan Glass wrote:
> I've written a little Perl script to monitor a log file and alert (in 
> this case, insert the flagged data into a DB) on a certain pattern.  The 
> parent process sits in an infinite loop watching the file, and whenever 
> the pattern is matched, a child process is forked to do the DB 
> insertion.  Anyone know the proper way to handle the death of all these 
> child processes?  If I run a 'ps -aef' on the box while the script is 
> running, I see dozens of '<defunct>' processes.
> 
> TIA
> 
> Jonathan Glass
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://www.ale.org/mailman/listinfo/ale



More information about the Ale mailing list