From: Rafael Garcia-Suarez Date: Wed, 7 Mar 2007 16:32:48 +0000 (+0000) Subject: Use another method to avoid the "possible interpolation" warning X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e879d94fd490498d2ab8c584f625025bbfa1d542;p=p5sagit%2Fp5-mst-13.2.git Use another method to avoid the "possible interpolation" warning for @- and @+ : do this directly from the lexer (patch by Yves Orton.) This way, @- and @+ aren't preloaded anymore. Avoid to require re::Tie::Hash::NamedCapture when the *- or *+ globs are created, this was breaking the build due to miniperl's inability to load it. p4raw-id: //depot/perl@30496 --- diff --git a/gv.c b/gv.c index a75203b..f0f2145 100644 --- a/gv.c +++ b/gv.c @@ -1225,7 +1225,10 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, SvREADONLY_on(tie); SvREADONLY_on(av); - require_tie_mod(gv, name, stashname, "FETCH", 0); + if (sv_type == SVt_PVHV) + require_tie_mod(gv, name, stashname, "FETCH", 0); + else + SvREFCNT_dec(stashname); break; } diff --git a/perl.c b/perl.c index 7acf664..3090375 100644 --- a/perl.c +++ b/perl.c @@ -4721,11 +4721,6 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register if (PL_minus_a) { (void) get_av("main::F", TRUE | GV_ADDMULTI); } - /* touch @- and @+ arrays to prevent spurious warnings 20020415 MJD */ - /* (but don't load the glob, since that requires loading - * re::Tie::Hash::NamedCapture, and miniperl can't do that */ - (void) hv_fetch(PL_defstash, "-", 1, GV_ADDMULTI); - (void) hv_fetch(PL_defstash, "+", 1, GV_ADDMULTI); } STATIC void diff --git a/toke.c b/toke.c index 5c4e4e2..c862b16 100644 --- a/toke.c +++ b/toke.c @@ -6987,7 +6987,11 @@ S_pending_ident(pTHX) if (pit == '@' && PL_lex_state != LEX_NORMAL && !PL_lex_brackets) { GV *gv = gv_fetchpv(PL_tokenbuf+1, 0, SVt_PVAV); if ((!gv || ((PL_tokenbuf[0] == '@') ? !GvAV(gv) : !GvHV(gv))) - && ckWARN(WARN_AMBIGUOUS)) + && ckWARN(WARN_AMBIGUOUS) + /* DO NOT warn for @- and @+ */ + && !( PL_tokenbuf[2] == '\0' && + ( PL_tokenbuf[1] == '-' || PL_tokenbuf[1] == '+' )) + ) { /* Downgraded from fatal to warning 20000522 mjd */ Perl_warner(aTHX_ packWARN(WARN_AMBIGUOUS),