summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2013-11-04 06:14:00 -0800
committerFather Chrysostomos <sprout@cpan.org>2013-11-04 20:26:04 -0800
commitea238638ab35cef3a59dff8b7a19970b7d76c1fd (patch)
treeed2e702ecccd54dd0139aec0c37f068823b6328c /gv.c
parente5e439840f3a970d3a8c9939fa15753d08575dac (diff)
downloadperl-ea238638ab35cef3a59dff8b7a19970b7d76c1fd.tar.gz
[perl #120462] Exempt $a and $b from ‘used once’ warnings
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gv.c b/gv.c
index 905d1313fb..62652fe0cb 100644
--- a/gv.c
+++ b/gv.c
@@ -1670,10 +1670,10 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
PERL_ARGS_ASSERT_GV_MAGICALIZE;
if (stash != PL_defstash) { /* not the main stash */
- /* We only have to check for three names here: EXPORT, ISA
+ /* We only have to check for a few names here: a, b, EXPORT, ISA
and VERSION. All the others apply only to the main stash or to
CORE (which is checked right after this). */
- if (len > 2) {
+ if (len) {
const char * const name2 = name + 1;
switch (*name) {
case 'E':
@@ -1688,6 +1688,11 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
if (strEQ(name2, "ERSION"))
GvMULTI_on(gv);
break;
+ case 'a':
+ case 'b':
+ if (len == 1 && sv_type == SVt_PV)
+ GvMULTI_on(gv);
+ /* FALL THROUGH */
default:
goto try_core;
}
@@ -2016,6 +2021,10 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
SvREFCNT_dec(sv);
}
break;
+ case 'a':
+ case 'b':
+ if (len == 1 && sv_type == SVt_PV)
+ GvMULTI_on(gv);
}
}