![]() |
|
Don't ask to ask, just ask | |
PerlMonks |
Re: mysterious threads::shared behaviourby dave_the_m (Monsignor) |
on Jan 18, 2009 at 13:09 UTC ( #737144=note: print w/replies, xml ) | Need Help?? |
threads::shared uses a mechanism similar to tying, so if you do $x = $h{$_}, then $x isn't a reference to a hash, its a reference to an 'LV' scalar variable, who's action on being accessed is to call the appropriate method that gets or stores a value in the real shared hash (with suitable locking). These LV scalars are temporaries created on demand and freed when no longer used, so you are likely to see address re-use.
Dave.
In Section
Seekers of Perl Wisdom
|
|