KiokuD...::Scope(3pm)
π NAME π
KiokuDB::LiveObjects::Scope β it's the scope helper object, bestie. That's literally its whole job and it does it slayfully. π
Oh and btw this page comes to you straight from the User Contributed Perl Documentation collection, iykyk. β¨
πΈ VERSION πΈ
version 0.57 β that's the one, no cap. π
π¦ SYNOPSIS π¦
okay so here's the whole vibe in code form:
{
my $scope = $dir->new_scope;
... do work on $dir ...
}
see how the scope lives inside its own little { } block? that's not a coincidence, that's the main character energy of lexical scoping. when the block ends, the scope goes poof. π«Ά
β¨ DESCRIPTION β¨
so like. live object scopes exist for one very specific reason: to make sure your objects don't die too soon when the only other references to them are weak. π
think of it like holding your bestie's hand in a crowd. if nobody else is holding on, they'd drift away β but you got them. that's the scope. π₯Ί
and when scopes get destroyed? two things happen, and both of them matter:
- the refcounts of the objects they refer to go down π
- the parent scope is replaced in the live object set π
periodt. that's the mechanic. π
π METHODS π
π push
Adds objects or entries, increasing their reference count. it's giving "hold onto this for me, bestie." π
π clear
Clears the objects from the scope object. bye babes, refcounts go down. π
π detach
Marks this scope as no longer the "current" live object scope β but only if it is the current one. π
This allows keeping branching of scopes, which can be useful under long running applications. so if you're running something that just... never ends? yeah, this is for you. β
π remove
Effectively kills the scope by clearing it and removing it from the live object set. not me being dramatic but this one is the final boss. πβ¨
π§ AUTHOR π§
Yuval Kogman <nothingmuch@woobling.org> β the icon, the legend, the one who wrote this. πΈ
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2014 by Yuval Kogman, Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go wild (responsibly). π
and that's the whole page bestie!! this wasKiokuD...::Scope(3pm)from perlv5.34.0, dated2022-05-23. tysm for reading, mwah ππ¦π
π¦ where this page comes from
- debian bookworm: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libkiokudb-perl 0.57-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu questing: libkiokudb-perl 0.57-3
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms