diff options
author | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 22:27:05 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2014-09-15 22:32:33 -0700 |
commit | a5f4774196bcd82b1f59014c5973ad9610ca913f (patch) | |
tree | 83afd3595d67624f25c9668f52fbeaf65e89e814 /pp_ctl.c | |
parent | 1d6bb9ae033c9dd42ee935e1458d658d0cca9183 (diff) | |
download | perl-a5f4774196bcd82b1f59014c5973ad9610ca913f.tar.gz |
Exclude lex sub package name from (caller $n)[3]
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.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r-- | pp_ctl.c | 7 |
1 files changed, 2 insertions, 5 deletions
@@ -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 { |