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;
}
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
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),