NAME

Devel::Caller::Util - caller()-related utility routines

VERSION

This document describes version 0.042 of Devel::Caller::Util (from Perl distribution Devel-Caller-Util), released on 2019-04-12.

SYNOPSIS

use Devel::Util::Caller qw(caller callers);

my @info = caller(3);

my @callers = callers();

FUNCTIONS

caller

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:

#  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.

$packages_to_ignore can be set to a regex (will be matched against $packageI) or an arrayref of package names.

Similarly, $subroutines_to_ignore can be set to a regex or an arrayref of subroutine names. Note that subroutine names are fully qualified names.

callers([ $start=0 [, $with_args [, $packages_to_ignore [, $subroutines_to_ignore ] ] ] ]) => LIST

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:

(
    #  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.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/Devel-Caller-Util.

SOURCE

Source repository is at https://github.com/perlancar/perl-Devel-Caller-Util.

BUGS

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.

SEE ALSO

AUTHOR

perlancar <perlancar@cpan.org>

COPYRIGHT AND LICENSE

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.