Devel:...Context(3pm)

πŸ’– Devel::MAT::Context β€” the manual page, but make it cute πŸ’–

okay bestie, this is Devel:...Context(3pm) from the User Contributed Perl Documentation collection, and it's literally all about representing one single call context state. slay.

✨ NAME ✨

Devel::MAT::Context β€” represent a single call context state 🫢

🌸 DESCRIPTION 🌸

so. objects in this class each represent one level of state from the call context. no cap. and these contexts? they represent function calls between perl functions. that's the whole vibe. πŸ’…


πŸ‘‘ COMMON METHODS πŸ‘‘

the methods everybody gets, no matter what kind of context they are:

πŸŽ€ gimme

$gimme = $ctx->gimme;

hands you back the gimme value of the call context. yes that's really what it's called, iykyk ✨

πŸ¦‹ file, line, location

$file = $ctx->file;

$line = $ctx->line;

$location = $ctx->location;

these three give you the file, the line, or the location β€” and the location comes formatted like ("FILE line LINE"). iconic little trio fr fr 🌈


πŸ“ Devel::MAT::Context::SUB πŸ“

this one represents a context that is a subroutine call. main character energy, honestly.

πŸ’œ cv

$cv = $ctx->cv;

returns the CV</> which this call is to. (yes, the CV. the code-y one. you got this πŸ’…)

wait, careful with that tag β€” let me say it clean: it returns the CV which this call is to. ✨

🧚 args

$args = $ctx->args;

returns the arguments AV β€” aka the thing that represents the @_ argument array. the whole squad of args, together 🫢

🌟 olddepth

$olddepth = $ctx->olddepth;

returns the old depth of the context β€” which is lowkey just "the depth the CV would be at after this context returns". think of it as the depth it's heading back to πŸ’«

πŸŽ€ depth

$depth = $ctx->depth;

returns the actual depth of the context. and here's the tea: this is inferred at load time, by looking at the olddepth of the next inner-nested call to the same CV β€” or, if no other call exists, from the actual depth of the CV. clever girl behavior, honestly πŸ”₯


🌈 Devel::MAT::Context::TRY 🌈

this class represents a context which is a block eval {} call. block eval girlies, this one's for you πŸ’–


⭐ Devel::MAT::Context::EVAL ⭐

this one represents a context which is a string eval EXPR call. the stringy sibling ✨

πŸ¦‹ code

$sv = $ctx->code;

returns the SV containing the text string that's being evaluated. it's giving the vibes, evaluated πŸ’…


πŸ’Œ AUTHOR πŸ’Œ

Paul Evans <leonerd@leonerd.org.uk> β€” thank you for your service, king πŸ‘‘


okay that's the whole page bestie, no skips, no shortcuts, we ate and left no crumbs 🍽️✨

this cutie was documented for perl v5.42.3, dated 2026-08-21, as part of Devel:...Context(3pm) β€” and that's a wrap, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from