in reply to Referencing localized variables, and typeglobs
Thank you Laurent, BrowserUk, AnomalousMonk, and Ken for the explanations and reassurances :-)
It does certainly make sense that the memory allocated for the localized data structures is subject to Perl's usual memory management, that is basically what I was hoping for, but couldn't immediately confirm, so thank you for your explanations. Here's another quick test I did:
use Devel::Refcount qw/refcount/; my $x; our %h = (one=>'two'); { local %h = (three=>'four'); $x = \%h; print "$x ", refcount($x), "\n"; } print "$x ", refcount($x), "\n"; __END__ HASH(0x2fb246a) 2 HASH(0x2fb246a) 1
|
|---|