.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Devel::Caller 3pm" .TH Devel::Caller 3pm "2020-11-09" "perl v5.32.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Devel::Caller \- meatier versions of "caller" .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 3 \& use Devel::Caller qw(caller_cv); \& $foo = sub { print "huzzah\en" if $foo == caller_cv(0) }; \& $foo\->(); # prints huzzah \& \& use Devel::Caller qw(called_with); \& sub foo { print called_with(0,1); } \& foo( my @foo ); # should print \*(Aq@foo\*(Aq .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .IP "caller_cv($level)" 4 .IX Item "caller_cv($level)" \&\f(CW\*(C`caller_cv\*(C'\fR gives you the coderef of the subroutine being invoked at the call frame indicated by the value of \f(CW$level\fR .IP "caller_args($level)" 4 .IX Item "caller_args($level)" Returns the arguments passed into the caller at level \f(CW$level\fR .ie n .IP "caller_vars( $level, $names ) =item called_with($level, $names)" 4 .el .IP "caller_vars( \f(CW$level\fR, \f(CW$names\fR ) =item called_with($level, \f(CW$names\fR)" 4 .IX Item "caller_vars( $level, $names ) =item called_with($level, $names)" \&\f(CW\*(C`called_with\*(C'\fR returns a list of references to the original arguments to the subroutine at \f(CW$level\fR. if \f(CW$names\fR is true, the names of the variables will be returned instead .Sp constants are returned as \f(CW\*(C`undef\*(C'\fR in both cases .IP "called_as_method($level)" 4 .IX Item "called_as_method($level)" \&\f(CW\*(C`called_as_method\*(C'\fR returns true if the subroutine at \f(CW$level\fR was called as a method. .SH "BUGS" .IX Header "BUGS" All of these routines are susceptible to the same limitations as \&\f(CW\*(C`caller\*(C'\fR as described in \*(L"caller\*(R" in perlfunc .PP The deparsing of the optree performed by called_with is fairly simple-minded and so a bit flaky. .IP "\(bu" 4 As a version 2.0 of Devel::Caller we no longer maintain compatibility with versions of perl earlier than 5.8.2. Older versions continue to be available from \s-1CPAN\s0 and backpan. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\*(L"caller\*(R" in perlfunc, PadWalker, Devel::Peek .SH "AUTHOR" .IX Header "AUTHOR" Richard Clamp with close reference to PadWalker by Robin Houston .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2002, 2003, 2006, 2007, 2008, 2010, 2013 Richard Clamp. All Rights Reserved. .PP This module is free software. It may be used, redistributed and/or modified under the same terms as Perl itself.