caller

caller

caller EXPR

caller

Returns the context of the current pure perl subroutine call. In scalar context, returns the caller's package name if there is a caller (that is, if we're in a subroutine or eval or require) and the undefined value 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;

With EXPR, it returns some extra information that the debugger uses to print a stack trace. The value of EXPR indicates how many call frames to go back before the current one.

登录查看完整内容