summaryrefslogtreecommitdiff
path: root/op.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-02-27 17:50:09 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-02-27 17:50:09 +0000
commitc99da3702f996b1fc1415a829383240bdf2f0fd2 (patch)
tree52f3b6e218561a59d3bcd9eb7fcc0bf35304582f /op.c
parent732319c68d6251d786fd16eefa858e3d18632820 (diff)
downloadperl-c99da3702f996b1fc1415a829383240bdf2f0fd2.tar.gz
Repatch from Robin Barker: anon subs in C<package;> are
now __ANON__::__ANON__ (should help for mod_perl breakage since #12251) p4raw-id: //depot/perl@14899
Diffstat (limited to 'op.c')
-rw-r--r--op.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/op.c b/op.c
index e39850e7c4..a03f0e5875 100644
--- a/op.c
+++ b/op.c
@@ -4755,13 +4755,15 @@ Perl_newATTRSUB(pTHX_ I32 floor, OP *o, OP *proto, OP *attrs, OP *block)
name = o ? SvPVx(cSVOPo->op_sv, n_a) : Nullch;
if (!name && PERLDB_NAMEANON && CopLINE(PL_curcop)) {
SV *sv = sv_newmortal();
- Perl_sv_setpvf(aTHX_ sv, "__ANON__[%s:%"IVdf"]",
+ Perl_sv_setpvf(aTHX_ sv, "%s[%s:%"IVdf"]",
+ PL_curstash ? "__ANON__" : "__ANON__::__ANON__",
CopFILE(PL_curcop), (IV)CopLINE(PL_curcop));
aname = SvPVX(sv);
}
else
aname = Nullch;
- gv = gv_fetchpv(name ? name : (aname ? aname : "__ANON__"),
+ gv = gv_fetchpv(name ? name : (aname ? aname :
+ (PL_curstash ? "__ANON__" : "__ANON__::__ANON__")),
GV_ADDMULTI | ((block || attrs) ? 0 : GV_NOINIT),
SVt_PVCV);
@@ -5179,7 +5181,9 @@ Used by C<xsubpp> to hook up XSUBs as Perl subs.
CV *
Perl_newXS(pTHX_ char *name, XSUBADDR_t subaddr, char *filename)
{
- GV *gv = gv_fetchpv(name ? name : "__ANON__", GV_ADDMULTI, SVt_PVCV);
+ GV *gv = gv_fetchpv(name ? name :
+ (PL_curstash ? "__ANON__" : "__ANON__::__ANON__"),
+ GV_ADDMULTI, SVt_PVCV);
register CV *cv;
if ((cv = (name ? GvCV(gv) : Nullcv))) {