Devel::Caller::Util - caller()-related utility routines
This document describes version 0.042 of Devel::Caller::Util (from Perl distribution Devel-Caller-Util), released on 2019-04-12.
use Devel::Util::Caller qw(caller callers); my @info = caller(3); my @callers = callers();
Usage:
caller([ $offset [, $with_args [, $packages_to_ignore [, $subroutines_to_ignore ] ] ] ]) => LIST
Just like the built-in caller(), except with three additional optional arguments. Will return this list:
caller()
# 0 1 2 3 4 5 6 7 8 9 10 ($package1, $filename1, $line1, $subroutine1, $hasargs1, $wantarray1, $evaltext1, $is_require1, $hints1, $bitmask1, $hinthash1)
If $with_args is true, will also return subroutine arguments in the 11th element of the result, produced by retrieving @DB::args.
$with_args
@DB::args
$packages_to_ignore can be set to a regex (will be matched against $packageI) or an arrayref of package names.
$packages_to_ignore
$packageI
Similarly, $subroutines_to_ignore can be set to a regex or an arrayref of subroutine names. Note that subroutine names are fully qualified names.
$subroutines_to_ignore
A convenience function to return the whole callers stack, produced by calling caller() repeatedly from frame $start+1 until caller() returns empty. Result will be like:
$start+1
( # 0 1 2 3 4 5 6 7 8 9 10 [$package1, $filename1, $line1, $subroutine1, $hasargs1, $wantarray1, $evaltext1, $is_require1, $hints1, $bitmask1, $hinthash1], [$package2, $filename2, $line2, ...], ... )
See "caller" for more information about the three additional, optional arguments.
Please visit the project's homepage at https://metacpan.org/release/Devel-Caller-Util.
Source repository is at https://github.com/perlancar/perl-Devel-Caller-Util.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=Devel-Caller-Util
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2019, 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Devel::Caller::Util, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Devel::Caller::Util
CPAN shell
perl -MCPAN -e shell install Devel::Caller::Util
For more information on module installation, please visit the detailed CPAN module installation guide.