IO::Lam...acktrace(3)
π 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
- alpine 3.24: perl-io-lambda-doc 1.34-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms