IO::Lam...acktrace(3)

πŸ“¦ version 1.34, in alpine 3.24

πŸ’– NAME πŸ’–

okay so bestie, welcome to IO::Lam...acktrace(3) from the User Contributed Perl Documentation β€” and the main character here is IO::Lambda::Backtrace, aka the module for backtrace chains of events. πŸ’…βœ¨

πŸ¦‹ DESCRIPTION πŸ¦‹

Picture it: a lambda is awaiting another lambda, and that one is in turn awaiting another, etc etc, and the chain is literally giving absolute chaos. 😭 This module makes debugging those chains of events easier.

The class IO::Lambda::Backtrace represents a set of such stacks, because a lambda can be awaited by more than one lambda. Each stack is an array of items, and each item contains the caller lambda and the invocation point. πŸ“šπŸ«Ά

The class provides helper methods for printing this information in readable form. Slay, periodt.

The module relies on the debug information about invocation points collected by IO::Lambda. By default, there's very little information collected, so in order to increase verbosity use the IO::Lambda::DEBUG_CALLER flag β€” either directly or through $ENV{IO_LAMBDA_DEBUG} = 'caller'. If the flag is set to 1, lambdas collect invocation points. If the flag is set to 2, then the additional perl stack trace is added too. πŸ”₯

ngl bestie, default debug info is lowkey crumbs β€” turn up the flag if you want the full tea. πŸ“

🌸 SYNOPSIS 🌸

use IO::Lambda;
$IO::Lambda::DEBUG_CALLER = 1;

lambda {
   ...
   warn this-> backtrace-> as_text;
}

or from command line:

env IO_LAMBDA_DEBUG=caller=2 ./myscript

πŸŽ€ API πŸŽ€

  • new($lambda) β€” extracts the information of the current chain of events and creates a new blessed reference of it. ✨
  • as_text β€” returns the backtrace information formatted as text, ready to display. πŸ’–
  • cluck β€” warns with the backtrace log. 🫢
  • confess β€” dies with the backtrace log. πŸ’€

πŸ‘‘ AUTHOR πŸ‘‘

Dmitry Karasik, <dmitry@karasik.eu.org>. πŸ’Œ

The ideas of backtracing threads of events, and implementing backtrace objects passable through execition stack are proposed by Ben Tilly. 🌈


okay that's the whole vibe check, bestie 😌 this is perl v5.42.2, dated 2026-02-15, and it's the IO::Lam...acktrace(3) page from the User Contributed Perl Documentation. mwah πŸ’‹

πŸ“¦ where this page comes from