I am using Parallel::ForkManager to fork a subroutine used in a perl script. This subroutine uses an array (called @array).
My script get confused because (I reckon) of the name of the array is shared by all forked children.
So that, the content of @array might not be the one I expect to be.
So I need to find a way to name this array dynamically so that it has a different name each time the subroutine is forked. I was thinking of using the value of the argument ($arg) passed to the subroutine (which is unique among all the fork processess)
How do I construct the name of my array ?
I tried something like: @(array.$arg) but it doesn't work...
Any idea ?
Thx,
U.
My script get confused because (I reckon) of the name of the array is shared by all forked children.
So that, the content of @array might not be the one I expect to be.
So I need to find a way to name this array dynamically so that it has a different name each time the subroutine is forked. I was thinking of using the value of the argument ($arg) passed to the subroutine (which is unique among all the fork processess)
How do I construct the name of my array ?
I tried something like: @(array.$arg) but it doesn't work...
Any idea ?
Thx,
U.