$VAR1 = {1}; $VAR2= { 'hammer' => 1 }; $VAR1 = {2}; $VAR2 = {}; within the foreach loop %result is defined, outsite not!sub whatEver(){ my $list = shift; #eg {'hammer' => "nail"} my %result = (); my $pm = new Parallel::ForkManager(10); foreach my $query (keys %{$list}) { $pm->start and next; $result{$query} = 1; print Dumper("1", \%result); $pm->finish(); # do the exit in the child process } $pm->wait_all_children; print Dumper("2", \%result); }
In reply to Parallel::ForkManager problem by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |