while (1) { $pm->start and next; ... # do child tasks here ... $pm->finish; } #### $pm->wait_all_children; #### $pmgr->run_on_finish( sub { my ($pid, $exit_code, $ident) = @_; waitpid $pid, 0; } );
## $pm->wait_all_children; ##
## $pmgr->run_on_finish( sub { my ($pid, $exit_code, $ident) = @_; waitpid $pid, 0; } );