while ($forked > 0) { print "[$forked] "; last if (waitpid(-1,0) == -1); sleep 1; }