/usr/share/doc/libdevel-backtrace-perl/examples/skipme.pl is in libdevel-backtrace-perl 0.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | #!/usr/bin/perl
use strict;
use warnings;
use Devel::Backtrace;
# This script demonstrates the use of the skipme method.
Foo::foo1();
{
package Foo;
sub foo1 {
foo2();
}
sub foo2 {
Bar::bar1();
}
}
{
package Bar;
sub bar1 {
bar2();
}
sub bar2 {
Baz::baz1();
}
}
{
package Baz;
sub baz1 {
baz2();
}
sub baz2 {
baz3();
}
sub baz3 {
my $backtrace = Devel::Backtrace->new;
# Tell Devel::Backtrace that we are not interested in what Baz method
# calls which Baz method.
$backtrace->skipme;
print "skipme result:\n";
print $backtrace;
my $backtrace2 = Devel::Backtrace->new;
# Tell Devel::Backtrace that we are not even interested where the first
# Baz method was called.
$backtrace2->skipmysubs;
print "\nskipmycalls result:\n";
print $backtrace2;
}
}
__END__
Output:
skipme result:
Baz::baz1 called from Bar (examples/skipme.pl:30)
Bar::bar2 called from Bar (examples/skipme.pl:26)
Bar::bar1 called from Foo (examples/skipme.pl:18)
Foo::foo2 called from Foo (examples/skipme.pl:14)
Foo::foo1 called from main (examples/skipme.pl:8)
skipmycalls result:
Bar::bar2 called from Bar (examples/skipme.pl:26)
Bar::bar1 called from Foo (examples/skipme.pl:18)
Foo::foo2 called from Foo (examples/skipme.pl:14)
Foo::foo1 called from main (examples/skipme.pl:8)
|