This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #134193) make the varname match the %[+-] names
authorTony Cook <tony@develop-help.com>
Mon, 17 Jun 2019 01:46:00 +0000 (11:46 +1000)
committerTony Cook <tony@develop-help.com>
Wed, 19 Jun 2019 04:22:10 +0000 (14:22 +1000)
when loading Tie/Hash/NamedCapture.pm for the long name variants

gv.c

diff --git a/gv.c b/gv.c
index 2b83680..652f5e7 100644 (file)
--- a/gv.c
+++ b/gv.c
@@ -2032,11 +2032,11 @@ S_gv_magicalize(pTHX_ GV *gv, HV *stash, const char *name, STRLEN len,
                     sv_magic(MUTABLE_SV(av), (SV*)n, PERL_MAGIC_regdata, NULL, 0);
                     SvREADONLY_on(av);
 
-                    require_tie_mod_s(gv, '-', "Tie::Hash::NamedCapture",0);
+                    require_tie_mod_s(gv, '+', "Tie::Hash::NamedCapture",0);
 
                 } else          /* %{^CAPTURE_ALL} */
                 if (memEQs(name, len, "\003APTURE_ALL")) {
-                    require_tie_mod_s(gv, '+', "Tie::Hash::NamedCapture",0);
+                    require_tie_mod_s(gv, '-', "Tie::Hash::NamedCapture",0);
                 }
                break;
            case '\005':        /* $^ENCODING */