Would like some explanation about how Parallel:ForkManager module works.
Suppose I have the following:
my $manager = new Parallel::ForkManager( 20 );
foreach my $command (@commands) {
$manager->start and next;
system( $command );
$manager->finish;
};
From what I understand, the "$manager->start" does the fork and "and next" goes to another $command in @command array (correct me if I am wrong there). Does it mean that I would have 20 child processes where each child would run "system($command)" for each $command in the array, right? And the parent is not going to run any of those "system($command)", right? What would the parent process do then? There is a problem I am having with ForkManager, but I first need to clarify that I understand how ForkManager works. Thank you.