StackTrace::Auto(3) User Contributed Perl Documentation StackTrace::Auto(3)

# [SYNOPSIS](#SYNOPSIS)

First, include StackTrace::Auto in a Moose or Mooclass...

```
  package Some::Class;
  # NOTE: Moo can also be used here instead of Moose
  use Moose;
  with 'StackTrace::Auto';
```

...then create an object of that class...

```
  my $obj = Some::Class->new;
```

...and now you have a stack trace for the object's creation.

```
  print $obj->stack_trace->as_string;
```

This attribute will contain an object representing the stack at the point when the error was generated and thrown. It must be an object performing the "as\_string" method.

This attribute may be provided to use an alternate class for stack traces. The default is Devel::StackTrace.

In general, you will not need to think about this attribute.

This attribute is an arrayref of arguments to pass when building the stack trace. In general, you will not need to think about it.

# [POD ERRORS](#POD_ERRORS)

Hey! **The above document had some coding errors, which are explained below:**

[Around line 26:](#Around)

Unknown directive: =attr

[Around line 32:](#Around~2)

Unknown directive: =attr

[Around line 73:](#Around~3)

Unknown directive: =attr

2026-10-26 perl v5.44.0

---

Document: StackTrace::Auto(3pm) from perl-throwable 1.001-r4 (Chainguard OS)
Source: https://github.com/rjbs/Throwable
