It does what you ask. You can only share scalars(including references). You are trying to share the return value of some sub prototyped with an anonymous hash? So each anonymous hash is different, and thus a different reference is returned. Beyond that, I'm confused too, as to what you are trying to do.my %h:shared; for (0..10) { $h{$_}=&share({}); }
In reply to Re: mysterious threads::shared behaviour
by zentara
in thread mysterious threads::shared behaviour
by ericatkin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |