diff options
author | Daniel Dragan <bulk88@hotmail.com> | 2013-07-13 18:20:09 -0400 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2013-07-13 17:44:05 -0700 |
commit | 1d56df500dec0bf9de438b0fa225eb363b006dcf (patch) | |
tree | f58dd82e4403622b96192370d01dcff27224d174 /pod/perlfunc.pod | |
parent | 66d813ca37e809ee893f2444cd6319914ce913e0 (diff) | |
download | perl-1d56df500dec0bf9de438b0fa225eb363b006dcf.tar.gz |
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.
Diffstat (limited to 'pod/perlfunc.pod')
-rw-r--r-- | pod/perlfunc.pod | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 8f157fd0ae..18ecd4099c 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; |