From: David Mitchell Date: Mon, 26 Sep 2016 13:59:26 +0000 (+0100) Subject: pad.c comments: clarify PERL_PADSEQ_INTRO X-Git-Tag: v5.25.6~169 X-Git-Url: https://perl5.git.perl.org/perl5.git/commitdiff_plain/4e785f27a1ab4651f67a4329a8eb1f6e1e8a0f8b pad.c comments: clarify PERL_PADSEQ_INTRO --- diff --git a/pad.c b/pad.c index bdaf948..4cc483c 100644 --- a/pad.c +++ b/pad.c @@ -85,9 +85,15 @@ PERL_PADSEQ_INTRO to indicate various stages: PERL_PADSEQ_INTRO 0 variable not yet introduced: { my ($x valid-seq# PERL_PADSEQ_INTRO variable in scope: - { my ($x) + { my ($x); valid-seq# valid-seq# compilation of scope complete: - { my ($x) } + { my ($x); .... } + +When a lexical var hasn't yet been introduced, it already exists from the +perspective of duplicate declarations, but not for variable lookups, e.g. + + my ($x, $x); # '"my" variable $x masks earlier declaration' + my $x = $x; # equal to my $x = $::x; For typed lexicals C points at the type stash. For C lexicals, C points at the stash of the associated global (so