Storm::...s::Scope(3)
π Storm::LiveObjects::Scope β the scope helper bestie π
okay so this is a page from the User Contributed Perl Documentation, section 3 (that's the manual name, periodt β¨), and it's all about Storm::LiveObjects::Scope, aka your little scope helper object π«Ά
πΈ NAME πΈ
Storm::LiveObjects::Scope β Scope helper object π
β¨ SYNOPSIS β¨
{
my $scope = $storm->new_scope;
... do work on objects ...
}
like. that's it. you make a scope, you do your little tasks inside the block, the scope dips out when the block ends. iconic behavior honestly π
π¦ DESCRIPTION π¦
Live object scopes exist for one extremely specific reason, and it's giving protective bestie: they make sure your objects don't die too soon if the only other references to them are weak π like imagine your object only has weak refs holding it up and they're all "we're just vibing, not committing" β yeah, the scope is the one actually holding it down fr fr.
When scopes get destroyed, the refcounts of the objects they refer to go down π, and the parent scope gets replaced in the live object set. that's the whole mechanism. no cap.
π METHODS π
pushβ Adds objects or entries, increasing their reference count. π it's literally just holding onto things harder so they stay alive.clearβ Clears the objects from the scope object. π§Ή bye bestie, refcounts drop, that's the whole point.
π SEE ALSO π
Modified from code in KiokuDB::LiveOBjects::Scope by Yuval Kogman. (yes the LiveOBjects capitalization is written exactly like that in the original β do not @ me, I'm just the messenger π)
lowkey reminder that this whole vibe is about reference counts and lifetime, so don't go clearing a scope while you still need the things inside it β that's how you get a sad, freed object and a segfault-adjacent situation π
and that's the page, bestie!! brought to you by perl v5.42.0, dated 2025-07-25 β thanks for coming to my TED talk, mwah πβ¨ππ¦
π¦ where this page comes from
- fedora 43: perl-Storm 0.240-34.fc43 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms