From: Charles Lane Date: Thu, 14 Dec 2000 20:04:42 +0000 (-0500) Subject: stuff for caller and _ in Safe:: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d86ca223b7bea516175c99c61fc271cc462a2de7;p=p5sagit%2Fp5-mst-13.2.git stuff for caller and _ in Safe:: Message-Id: <001214200310.49929@DUPHY4.Physics.Drexel.Edu> p4raw-id: //depot/perl@8127 --- diff --git a/ext/Opcode/Opcode.xs b/ext/Opcode/Opcode.xs index e191ec7..04f7c3f 100644 --- a/ext/Opcode/Opcode.xs +++ b/ext/Opcode/Opcode.xs @@ -253,6 +253,12 @@ PPCODE: save_hptr(&PL_defstash); /* save current default stash */ /* the assignment to global defstash changes our sense of 'main' */ PL_defstash = gv_stashpv(Package, GV_ADDWARN); /* should exist already */ + if (strNE(HvNAME(PL_defstash),"main")) { + Safefree(HvNAME(PL_defstash)); + HvNAME(PL_defstash) = savepv("main"); /* make it think it's in main:: */ + hv_store(PL_defstash,"_",1,(SV *)PL_defgv,0); /* connect _ to global */ + SvREFCNT_inc((SV *)PL_defgv); /* want to keep _ around! */ + } save_hptr(&PL_curstash); PL_curstash = PL_defstash;