diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-27 17:50:09 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-02-27 17:50:09 +0000 |
commit | c99da3702f996b1fc1415a829383240bdf2f0fd2 (patch) | |
tree | 52f3b6e218561a59d3bcd9eb7fcc0bf35304582f /op.c | |
parent | 732319c68d6251d786fd16eefa858e3d18632820 (diff) | |
download | perl-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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))) { |