From a5f4774196bcd82b1f59014c5973ad9610ca913f Mon Sep 17 00:00:00 2001 From: Father Chrysostomos Date: Mon, 15 Sep 2014 22:27:05 -0700 Subject: Exclude lex sub package name from (caller $n)[3] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit ae77754ae caused it to start including the package name. Pre- viously, lexical subs were reported as ‘(unknown)’. Now we have more expected output: $ ./perl -Ilib -XMfeature=:all -e 'my sub x{warn +(caller 0)[3]} x' x at -e line 1. --- pp_ctl.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'pp_ctl.c') diff --git a/pp_ctl.c b/pp_ctl.c index 108643e921..4ceca53dc2 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -1806,12 +1806,9 @@ PP(pp_caller) if (!has_arg) RETURN; if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) { - GV * const cvgv = CvGV(dbcx->blk_sub.cv); /* So is ccstack[dbcxix]. */ - if (cvgv && isGV(cvgv)) { - SV * const sv = newSV(0); - gv_efullname3(sv, cvgv, NULL); - mPUSHs(sv); + if (CvHASGV(dbcx->blk_sub.cv)) { + PUSHs(cv_name(dbcx->blk_sub.cv, 0)); PUSHs(boolSV(CxHASARGS(cx))); } else { -- cgit v1.2.1