Optional parameters: -start => $start, -format => $format
If only one parameter is given, it will be used as $start.
Constructs a new Devel::Backtrace which is filled with all the information
caller($i) provides, where $i starts from $start. If no argument is
given, $start defaults to 0.
If $start is 1 (or higher), the backtrace wont contain the information that
(and where) Devel::Backtrace::new() was called.
Returns the ith tracepoint as a Devel::Backtrace::Point object (see its documentation
for how to access every bit of information).
Note that the following code snippet will print the information of
Returns a list of all tracepoints. In scalar context, the number of
tracepoints is returned.
This method deletes all leading tracepoints that contain information about calls
within $package. Afterwards the $backtrace will look as though it had
been created with a higher value of $start.
If the optional parameter $package is not given, it defaults to the calling
The effect is similar to what the Carp module does.
This module ships with an example skipme.pl that demonstrates how to use this
method. See also EXAMPLES.
This method is like skipme except that it deletes calls to the package
rather than calls from the package.
Before discarding those calls, skipme is called. This is because usually
the topmost call in the stack is to Devel::Backtrace->new, which would not be
catched by skipmysubs otherwise.
This means that skipmysubs usually deletes more lines than skipme would.
skipmysubs was added in Devel::Backtrace version 0.06.
See also EXAMPLES and the example skipme.pl.
Returns a string that contains one line for each tracepoint. It will contain
the information from Devel::Backtrace::Points to_string() method. To get
more information, use the to_long_string() method.
Note that you dont have to call to_string() if you print a Devel::Backtrace
object or otherwise treat it as a string, as the stringification operator is
Returns a very long string that contains several lines for each trace point.
The result will contain every available bit of information. See
to_long_string in Devel::Backtrace::Point for an example of what the result
A sample stringification might look like this:
Devel::Backtrace::new called from MyPackage (foo.pl:30)
MyPackage::test2 called from MyPackage (foo.pl:28)
MyPackage::test1 called from main (foo.pl:18)
main::bar called from main (foo.pl:6)
main::foo called from main (foo.pl:13)
If MyPackage called skipme, the first two lines would be removed. If it called
skipmysubs, the first three lines would be removed.
If you dont like the format, you can change it:
my $backtrace = Devel::Backtrace->new(-format => %I. %s);
This would produce a stringification of the following form: