StackTrace::Auto(3)

πŸ’… StackTrace::Auto

okay so this is StackTrace::Auto, straight out of the User Contributed Perl Documentation section of your friendly neighbourhood man command, and it's literally a role for generating stack traces during instantiation. yes bestie, it does exactly what it says on the tin ✨

πŸŽ€ VERSION

version 1.001 β€” she's serving, she's stable, she's iconic.


πŸ¦‹ SYNOPSIS

okay so step one: include StackTrace::Auto in a Moose or Moo class.

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

...then you just make an object of that class, like the main character you are:

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

...and boom πŸ’₯ now you have a stack trace for the object's creation. no cap.

print $obj->stack_trace->as_string;

that's it. that's the whole vibe. 🫢


🌸 PERL VERSION

okay so the tea here is: this library should run on perls released even a long time ago. like, actually long. it should work on any version of perl released in the last five years. πŸ•°οΈ

but β€” and hear me out β€” although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. the version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl. so like... don't come for her about old perl, she's not doing that today πŸ’€


πŸ‘‘ ATTRIBUTES

πŸ’œ stack_trace

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, okay? that's the whole requirement. put some respect on as_string. πŸŽ€

stack_trace_class

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. like genuinely bestie, let it live its life, it's fine πŸ™ˆ

🌈 stack_trace_args

this attribute is an arrayref of arguments to pass when building the stack trace. in general, you will not need to think about it. same energy as above β€” not your problem, she's got it handled. 🧚


⭐ AUTHORS

  • Ricardo SIGNES <cpan@semiotic.systems>
  • Florian Ragwitz <rafl@debian.org>

two absolute legends, we stan 🫢


this software is copyright (c) 2022 by Ricardo SIGNES.

this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. slay.


so yeah, that's the page, bestie πŸ’… you're all caught up. this icon was documented by the fine folks at perl v5.42.0, dated 2023-01-03, and it's StackTrace::Auto(3) all the way down. go forth and trace those stacks πŸ¦‹πŸŒΈβœ¨

πŸ“¦ where this page comes from