Re: [ID 20010526.001] localized glob loses value when assigned to
authorRichard Soderberg <p5-authors@crystalflame.net>
Sat, 26 May 2001 06:44:20 +0000 (23:44 -0700)
committerJarkko Hietaniemi <jhi@iki.fi>
Wed, 13 Jun 2001 14:07:43 +0000 (14:07 +0000)
Message-ID: <NAEKLNAAHLMBPMPNBMLECECHDFAA.rs@crystalflame.net>

p4raw-id: //depot/perl@10563

sv.c
t/op/glob.t

diff --git a/sv.c b/sv.c
index 3ae98ef..6b6e063 100644 (file)
--- a/sv.c
+++ b/sv.c
@@ -3215,12 +3215,7 @@ Perl_sv_setsv_flags(pTHX_ SV *dstr, register SV *sstr, I32 flags)
 #endif
 
                if (intro) {
-                   GP *gp;
-                   gp_free((GV*)dstr);
                    GvINTRO_off(dstr);  /* one-shot flag */
-                   Newz(602,gp, 1, GP);
-                   GvGP(dstr) = gp_ref(gp);
-                   GvSV(dstr) = NEWSV(72,0);
                    GvLINE(dstr) = CopLINE(PL_curcop);
                    GvEGV(dstr) = (GV*)dstr;
                }
index 98efc3d..2eb371a 100755 (executable)
@@ -5,7 +5,7 @@ BEGIN {
     @INC = '../lib';
 }
 
-print "1..7\n";
+print "1..10\n";
 
 @oops = @ops = <op/*>;
 
@@ -48,3 +48,11 @@ for (1..2) {
     ++$i;
 }
 print $i == 2 ? "ok 7\n" : "not ok 7\n";
+
+# [ID 20010526.001] localized glob loses value when assigned to
+
+$j=1; %j=(a=>1); @j=(1); local *j=*j; *j = sub{};
+
+print $j    == 1 ? "ok 8\n"  : "not ok 8\n";
+print $j{a} == 1 ? "ok 9\n"  : "not ok 9\n";
+print $j[0] == 1 ? "ok 10\n" : "not ok 10\n";