Perl: the Markov chain saw | |
PerlMonks |
comment on |
( [id://3333]=superdoc: 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 reply to Re: bug in threads::shared or is it just me?
by zentara
|
|