Gergely Nagy wrote: > +my $processes=0; > +my $max_procs=0; Wouldn't it be simpler to default $max_procs to 1, rather than the current special-cased handling of 0 via $forked etc?
> + } else {
Hmm, there is no check for fork having failed. ($pid would be undef)
> + if (++$processes > 1) {
> + wait;
> + --$processes;
It's impossible for this code block to not run, and it seems to cause
only one child to run at a time, since $processes will always be
incremented to 1, the child waited on, and then it decremented again.
--
see shy jo
signature.asc
Description: Digital signature

