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! }