Murcia has asked for the wisdom of the Perl Monks concerning the following question:
$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); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Parallel::ForkManager problem
by tirwhan (Abbot) on Mar 28, 2006 at 09:56 UTC | |
by salva (Canon) on Mar 28, 2006 at 10:49 UTC | |
by tirwhan (Abbot) on Mar 28, 2006 at 10:58 UTC | |
|
Re: Parallel::ForkManager problem
by salva (Canon) on Mar 28, 2006 at 11:08 UTC | |
by Murcia (Monk) on Mar 28, 2006 at 15:39 UTC | |
by Limbic~Region (Chancellor) on Mar 28, 2006 at 15:50 UTC | |
by salva (Canon) on Mar 28, 2006 at 16:09 UTC | |
by Limbic~Region (Chancellor) on Mar 28, 2006 at 16:20 UTC | |
by Murcia (Monk) on Mar 28, 2006 at 16:19 UTC | |
by salva (Canon) on Mar 28, 2006 at 22:13 UTC |