summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-12-03 21:51:45 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-12-03 21:51:45 +0000
commit133706a6af5890d9737eb5c4dacb6252623311ea (patch)
tree9cfa88f97ca4f18c0a72ee7f852eb9feda593dfe /op.c
parent7a1e2023d90d879c7a6110f7be3e3c6e22bddc33 (diff)
downloadperl-133706a6af5890d9737eb5c4dacb6252623311ea.tar.gz
$foo::_ was wrongly forced as $main::_.
Since we still want "our $_" to be always forced to $main::_, deplace the forcing code at our-pad allocation time. (Making execution probably a tiny bit faster) p4raw-id: //depot/perl@23608
Diffstat (limited to 'op.c')
-rw-r--r--op.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/op.c b/op.c
index 8a5c765bc7..96be415fd7 100644
--- a/op.c
+++ b/op.c
@@ -256,7 +256,8 @@ Perl_allocmy(pTHX_ char *name)
off = pad_add_name(name,
PL_in_my_stash,
(PL_in_my == KEY_our
- ? (PL_curstash ? PL_curstash : PL_defstash)
+ /* $_ is always in main::, even with our */
+ ? (PL_curstash && !strEQ(name,"$_") ? PL_curstash : PL_defstash)
: Nullhv
),
0 /* not fake */