go ahead... be a heretic | |
PerlMonks |
Re: Shared hash of anonymous arrays?by mreece (Friar) |
on Aug 29, 2006 at 22:17 UTC ( [id://570267]=note: print w/replies, xml ) | Need Help?? |
note the synopsis from 'perldoc threads::shared' uses the :shared attribute or the share() function, but not both on the same variable.
try removing the :shared attribute from the my %foo declaration. (do you intend to share the entire hash %foo or only $foo{bar}?) updated: i'm potentially way off base there, i am able to get it to 'work' (that is, stop producing the "Invalid value for shared scalar" error) using this approach or the others mentioned (@{$foo{'bar'}} = ($i, $j, $k);). it does seem plausible that you can't re-assign a new array-ref to a shared variable, but who knows what magic lurks beneath...? (not i!)
In Section
Seekers of Perl Wisdom
|
|