http://qs1969.pair.com?node_id=717369


in reply to shared complex scalars between threads

The two above give good suggestions. Your problem at the moment, I think, is that you are only sharing that variable - any deep structure is not shared. See this from threads::shared:

"share" will traverse up references exactly one level. "share(\$a)" is equivalent to "share($a)", while "share(\\$ +a)" is not. This means that you must create nested shared data st +ructures by first creating individual shared leaf notes, then adding + them to a shared hash or array.

I haven't tried it, but as BrowserUK points out the newer versions of threads::shared claim to do what you want.