summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2000-01-14 04:16:51 +0000
committerGurusamy Sarathy <gsar@cpan.org>2000-01-14 04:16:51 +0000
commitf472eb5c07ed95306a11c98250bda17aae994339 (patch)
treeec0f98c535a7112418134f68146d78b4344ec604 /toke.c
parent192587c2153e5b0fa4ed545cdd3fa7fef8fc0d8b (diff)
downloadperl-f472eb5c07ed95306a11c98250bda17aae994339.tar.gz
nailed "our" declarations, and better warnings on duplicate
"our" declarations p4raw-id: //depot/perl@4801
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/toke.c b/toke.c
index f35a0421f3..a38f58f9d2 100644
--- a/toke.c
+++ b/toke.c
@@ -2015,15 +2015,19 @@ Perl_yylex(pTHX)
}
#endif /* USE_THREADS */
if ((tmp = pad_findmy(PL_tokenbuf)) != NOT_IN_PAD) {
+ SV *namesv = AvARRAY(PL_comppad_name)[tmp];
/* might be an "our" variable" */
- if (SvFLAGS(AvARRAY(PL_comppad_name)[tmp]) & SVpad_OUR) {
+ if (SvFLAGS(namesv) & SVpad_OUR) {
/* build ops for a bareword */
- yylval.opval = (OP*)newSVOP(OP_CONST, 0, newSVpv(PL_tokenbuf+1, 0));
+ SV *sym = newSVpv(HvNAME(GvSTASH(namesv)),0);
+ sv_catpvn(sym, "::", 2);
+ sv_catpv(sym, PL_tokenbuf+1);
+ yylval.opval = (OP*)newSVOP(OP_CONST, 0, sym);
yylval.opval->op_private = OPpCONST_ENTERED;
- gv_fetchpv(PL_tokenbuf+1,
+ gv_fetchpv(SvPVX(sym),
(PL_in_eval
- ? (GV_ADDMULTI | GV_ADDINEVAL | GV_ADDOUR)
- : GV_ADDOUR
+ ? (GV_ADDMULTI | GV_ADDINEVAL)
+ : TRUE
),
((PL_tokenbuf[0] == '$') ? SVt_PV
: (PL_tokenbuf[0] == '@') ? SVt_PVAV