The call to $pm->start creates a new process with it's own memory address space, variables are not shared between processes. So once you have 10 processes started you have 11 versions of the hash %result in memory, each of them addressable only from the process it belongs to. The one you access outside the loop belongs to the parent process and is never modified.
If you want to use a shared variable you may want to consider using threads instead of processes. Alternatively, use one of the forms of interprocess communication described in perldoc perlipc or search CPAN for "IPC" or "shared".
In reply to Re: Parallel::ForkManager problem
by tirwhan
in thread Parallel::ForkManager problem
by Murcia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |