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); }