Help for this page

Select Code to Download


  1. or download this
    sub REAPER { # don't work almost on windows
            while (($child = waitpid(-1,WNOHANG)) > 0) {}
            $SIG{CHLD} = \&REAPER;
    }
    
    $SIG{CHLD} = \&REAPER;
    
  2. or download this
    use POSIX ":sys_wait_h"; 
    
    ...
    #waitpid $CHILD{2}, WNOHANG; # wait;
    #waitpid $CHILD{3}, WNOHANG; # wait;
    print "parent process\n";