The fact that you changed the variable associated with package variable %main::foo has no bearing on the contents of lexical var %foo.
use strict; use warnings; my $hashref = { "key" => "value" }; my %foo; local *foo = $hashref; # Short for *main::foo printf("keys=%d\n", scalar(keys(%main::foo))); # keys=1 printf("keys=%d\n", scalar(keys(%foo))); # keys=0
In reply to Re: typeglob & my | our
by ikegami
in thread typeglob & my | our
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |