From: Mark-Jason Dominus Date: Mon, 15 Apr 2002 02:41:52 +0000 (-0400) Subject: Supporess spurious warnings for @+ and and @- X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2710853f89981101efd1c81d1b1394f8120c34e7;p=p5sagit%2Fp5-mst-13.2.git Supporess spurious warnings for @+ and and @- Message-ID: <20020415064152.16958.qmail@plover.com> p4raw-id: //depot/perl@15921 --- diff --git a/perl.c b/perl.c index 3da8a12..b17448b 100644 --- a/perl.c +++ b/perl.c @@ -3472,10 +3472,6 @@ Perl_init_argv_symbols(pTHX_ register int argc, register char **argv) (void)sv_utf8_decode(sv); } } - - if (PL_minus_a) { - (void) get_av("main::F", TRUE | GV_ADDMULTI); - } } #ifdef HAS_PROCSELFEXE @@ -3578,6 +3574,14 @@ S_init_postdump_symbols(pTHX_ register int argc, register char **argv, register sv_setiv(GvSV(tmpgv), (IV)PerlProc_getpid()); SvREADONLY_on(GvSV(tmpgv)); } + + /* touch @F array to prevent spurious warnings 20020415 MJD */ + if (PL_minus_a) { + (void) get_av("main::F", TRUE | GV_ADDMULTI); + } + /* touch @- and @+ arrays to prevent spurious warnings 20020415 MJD */ + (void) get_av("main::-", TRUE | GV_ADDMULTI); + (void) get_av("main::+", TRUE | GV_ADDMULTI); } STATIC void diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index 7f7d84d..d2695d6 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -787,4 +787,12 @@ Name "main::F" used only once: possible typo at - line 4. # 20020414 mjd-perl-patch+@plover.com EXPECT +######## +# toke.c +# 20020414 mjd-perl-patch+@plover.com +# In 5.7.3, this emitted "Possible unintended interpolation" warnings +use warnings 'ambiguous'; +$s = "(@-)(@+)"; +EXPECT +