plagent has asked for the wisdom of the Perl Monks concerning the following question:
my $pwm_count_hash = undef; PWM: for my $pwm (@ciona_pwm_array) { $pm->start and next PWM; ($pwm_count_hash->{$pwm}) = count_pwm_num($pwm,$seq_1,$seq_2); #print $pwm,"\t",$pwm_count_hash->{$pwm},"\n"; $pm->finish; } $pm->wait_all_children; foreach my $id (keys %{$pwm_count_hash}) { print $id,"\t",$pwm_count_hash->{$id},"\n"; # no printing here! }
I declared a hash reference ($pwm_count_hash) outside of parallel processing fork.However, when terminating all child process, this value ($pwm_count_hash) was still undefined. The foreach loop after forking processing lead to no result. I expect that this value had been defined after each child process.
I think this may be related to child-parent talk. But I have a little knowledge of it. Please let me know how to initialize $pwm_count_hash in the child process.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: value uninitilized when using Parallel::ForkManager module
by Anonymous Monk on Apr 14, 2015 at 06:51 UTC | |
|
Re: value uninitilized when using Parallel::ForkManager module
by Laurent_R (Canon) on Apr 14, 2015 at 06:37 UTC | |
by afoken (Chancellor) on Apr 14, 2015 at 16:07 UTC | |
by Laurent_R (Canon) on Apr 14, 2015 at 17:45 UTC | |
|
Re: value uninitilized when using Parallel::ForkManager module
by atcroft (Abbot) on Apr 14, 2015 at 18:49 UTC |