Help for this page

Select Code to Download


  1. or download this
    my @pids = $get_pidof('fork.pl', 1);
    
  2. or download this
           wait    Behaves like the wait(2) system call on your system: it
    + waits
                   for a child process to terminate and returns the pid of
    + the
    ...
                   status is returned in $?.  Note that a return value of 
    +"-1"
                   could mean that child processes are being automatically
    + reaped,
                   as described in perlipc.
    
  3. or download this
    while (1) {
        my $completed_pid = waitpid(-1, WNOHANG);
    ...
            sleep 1;
        }
    }