From 4e785f27a1ab4651f67a4329a8eb1f6e1e8a0f8b Mon Sep 17 00:00:00 2001 From: David Mitchell Date: Mon, 26 Sep 2016 14:59:26 +0100 Subject: [PATCH] pad.c comments: clarify PERL_PADSEQ_INTRO --- pad.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) 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 -- 1.8.3.1