Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re: bug in threads::shared or is it just me?by zentara (Archbishop) |
on Apr 05, 2012 at 16:46 UTC ( [id://963712]=note: print w/replies, xml ) | Need Help?? |
is this a bug, or the intended behaviour? I think its neccessary behavior. If the shared variable declaration is inside a scoped sub, how can the main:: thread keep it shared in it's global scope? As soon as the sub finishes, the shared var is out of scope. I always have seen shared vars declared in the global section of main::. You might be confusing the behavior of shared with our? Look at this code where our is used instead of my. It works.
I'm not really a human, but I play one on earth. Old Perl Programmer Haiku ................... flash japh
In Section
Seekers of Perl Wisdom
|
|