Does someone know how to push data into an array as part of a fork process ??
I always get an empty array.
My code looks like this (I am using Parallel::ForkManager):
my $pid;
my $pm = new Parallel:ForkManager(5);
foreach my $element (@list){
$pid = $pm->start and next;
...
$result = ....
...
push @array, $result;
$pm->finish;
}
print for @array;
I always get an empty array.
My code looks like this (I am using Parallel::ForkManager):
my $pid;
my $pm = new Parallel:ForkManager(5);
foreach my $element (@list){
$pid = $pm->start and next;
...
$result = ....
...
push @array, $result;
$pm->finish;
}
print for @array;