In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/1d56df500dec0bf9de438b0fa225eb363b006dcf?hp=66d813ca37e809ee893f2444cd6319914ce913e0>
- Log ----------------------------------------------------------------- commit 1d56df500dec0bf9de438b0fa225eb363b006dcf Author: Daniel Dragan <[email protected]> Date: Sat Jul 13 18:20:09 2013 -0400 mention that caller() does not show XSUBs Part of Perl #113438. Someone may write a pure perl sub, or callback from an XSUB to PP to use caller, to check the package of the sub that called the current sub and have different behaviour based on the caller sub's package. Also using a perl debugger will not show XSUB frames in the call stack. Therefore document this limitation of caller. ----------------------------------------------------------------------- Summary of changes: pod/perlfunc.pod | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 8f157fd..18ecd40 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -733,10 +733,12 @@ X<caller> X<call stack> X<stack> X<stack trace> =for Pod::Functions get context of the current subroutine call -Returns the context of the current subroutine call. In scalar context, -returns the caller's package name if there I<is> a caller (that is, if +Returns the context of the current pure perl subroutine call. In scalar +context, returns the caller's package name if there I<is> a caller (that is, if we're in a subroutine or C<eval> or C<require>) and the undefined value -otherwise. In list context, returns +otherwise. caller never returns XS subs and they are skipped. The next pure +perl sub will appear instead of the XS sub in caller's return values. In list +context, caller returns # 0 1 2 ($package, $filename, $line) = caller; -- Perl5 Master Repository
