summaryrefslogtreecommitdiff
path: root/gv.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2016-07-30 19:37:04 -0700
committerFather Chrysostomos <sprout@cpan.org>2016-07-31 06:35:04 -0700
commit7bb33634741e6401456a85c49eb51fe0fc1aefc7 (patch)
tree778f0ff96762e17e730aa67b5941560c6b079709 /gv.c
parentfc273927378ed6a1a60a5758f7e36713630d5e13 (diff)
downloadperl-7bb33634741e6401456a85c49eb51fe0fc1aefc7.tar.gz
Exempt @DB::args from ‘used once’ warnings
A perfectly benign use of @DB::args like sub foo { package DB { () = caller 0 } print "@DB::args\n" } foo(1..3); warns under -w, though that is exactly its intended use. That is is not nice. warnings.pm itself uses @DB::args, which is why this went unnoticed for so many years. This commit eliminates the ‘used once’ warning, but the ‘Possible unintended interpolation’ message that that code produces will be handled in another commit.
Diffstat (limited to 'gv.c')
-rw-r--r--gv.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gv.c b/gv.c
index 46eb079b8f..4ea0917f50 100644
--- a/gv.c
+++ b/gv.c
@@ -1831,6 +1831,10 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
GvMULTI_on(gv);
break;
case 'a':
+ if (stash == PL_debstash && len==4 && strEQ(name2,"rgs")) {
+ GvMULTI_on(gv_AVadd(gv));
+ break;
+ }
case 'b':
if (len == 1 && sv_type == SVt_PV)
GvMULTI_on(gv);