From: Rafael Garcia-Suarez Date: Wed, 7 Mar 2007 10:33:38 +0000 (+0000) Subject: Avoid to load the *+ and *- globs too early. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66e4e5d58b6f1a43b01a82c3d198f3a5add40b57;p=p5sagit%2Fp5-mst-13.2.git Avoid to load the *+ and *- globs too early. To silence spurious interpolation warnings, merely create the stash entry for them. Ensure that the re::Tie::Hash::NamedCapture module is always loaded when we have created the tied hashes %+ and %-. Revert change #30483, which is now unnecessary. p4raw-link: @30483 on //depot/perl: 73f68b39467596f862aade4f4b46d6061aa98bd3 p4raw-id: //depot/perl@30490 --- diff --git a/gv.c b/gv.c index 95ff938..a75203b 100644 --- a/gv.c +++ b/gv.c @@ -1211,8 +1211,8 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, HV *const hv_tie = newHV(); SV *tie = newRV_noinc((SV*)hv_tie); - sv_bless(tie, gv_stashsv(stashname,GV_ADD)); - hv_magic(hv, (GV*)tie, PERL_MAGIC_tied); + sv_bless(tie, gv_stashsv(stashname, GV_ADD)); + hv_magic(hv, (GV*)tie, PERL_MAGIC_tied); sv_magic((SV*)av, (plus ? (SV*)av : NULL), PERL_MAGIC_regdata, NULL, 0); sv_magic(GvSVn(gv), (SV*)gv, PERL_MAGIC_sv, name, len); @@ -1220,15 +1220,12 @@ Perl_gv_fetchpvn_flags(pTHX_ const char *nambeg, STRLEN full_len, I32 flags, SvREADONLY_on(GvSVn(gv)); else Perl_hv_store(aTHX_ hv_tie, STR_WITH_LEN("all"), newSViv(1), 0); - + SvREADONLY_on(hv); SvREADONLY_on(tie); SvREADONLY_on(av); - - if (sv_type == SVt_PVHV) - require_tie_mod(gv, name, stashname, "FETCH", 0); - else - SvREFCNT_dec(stashname); + + require_tie_mod(gv, name, stashname, "FETCH", 0); break; } diff --git a/lib/dumpvar.pl b/lib/dumpvar.pl index d02ebb9..0268cea 100644 --- a/lib/dumpvar.pl +++ b/lib/dumpvar.pl @@ -377,7 +377,6 @@ sub dumpglob { unwrap(\@entry,3+$off,$m) ; print( (' ' x $off) . ")\n" ); } - if ($key eq '-') { eval { require re::Tie::Hash::NamedCapture } } if ($key ne "main::" && $key ne "DB::" && %entry && ($dumpPackages or $key !~ /::$/) && ($key !~ /^_