Hey,

    I got a script that I use Parallel::ForkManager, which works
great...
the only problem is that I want a child to fork another process and
Parallel::ForkManager does not allow that.

  So for my first fork I use it but in the child I am trying to use the
normal oreilly FORK but I am missing something stupid.


my @list = "bla, bla, bla, bla, bla";
foreach my $item(@list) {
        my $pid;
        FORK: {
            if ($pid=fork) {
                   print"$pid\n";
            }elsif (defined $pid){
             #do other perl stuff to $item
            exit 0;
            } elsif ($! =~/No more process/) {
            sleep 5;
            redo FORK;
            }
       } 
}

   What I want to do, is have the fork, process $item before it goes
onto the next $item.  But as it is written it forks every $item in the
@list.

   Just fork, finish, repeat until all $item are done.

Can any offer any suggestions?

THanks,
CHad

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to