A reasonable guess:
"When you return an object the entire stash that the object is in is blessed as well"
Googling a but led me to
Change 18424 in the Perl source, where it is stated that it
"Fixes bug #15273, the return of the object caused
the stash of the object to be cloned, cloning the entire syntax
tree and all lexicals in there creating danglning copies to the
object. (Pararell but unlinked STASH tree).
This adds a new flag, when set it will use STASHES from the
thread we are joining into avoiding the problem."
Not that this will explain it any further, but
as far as I can understand, it means that when you return a variable from one thread to another, the the entire stash (read package) is made available to the other thread.
Note this guess could be most amazingly and stupidly wrong so YMMV.
It is obviously in the
deep magic area. I think you have (at least) these options:
- don your wizards hat and read the code
- mail Arthur "Sky" Bergman and ask him
- never mind and go on as before
Henrik Tougaard: Not an internals wizard, but I have been in there and got out again nearly unscathed.