MooseX...nstance(3pm)
π MooseX::GlobRef::Role::Meta::Instance π
okay bestie, gather round, because today we're talking about MooseX::GlobRef::Role::Meta::Instance β yes that's the whole name, she's long, she's dramatic, she's from the User Contributed Perl Documentation collection and she ate. π
This is the instance metaclass for MooseX::GlobRef, and ngl she's doing something kinda iconic: letting a Moose object live inside a glob reference of a file handle. Wild. Love that for her. π¦
β¨ NAME β¨
MooseX::GlobRef::Role::Meta::Instance β the instance metaclass for MooseX::GlobRef, no cap. π
π SYNOPSIS π
here's the vibe, copy-paste it exactly bestie, don't freestyle:
Moose::Util::MetaRole::apply_metaclass_roles(
for_class => $caller,
instance_metaclass_roles =>
[ 'MooseX::GlobRef::Role::Meta::Instance' ],
);
like, that's it. that's the whole ritual. π―οΈβ¨
πΈ DESCRIPTION πΈ
so the tea is: this instance metaclass lets you store a Moose object in a glob reference of a file handle. it's not something you apply yourself by hand β MooseX::GlobRef is the one that applies it. so if you're out here manually slapping this role on things, that's not the intended path, bestie. let MooseX::GlobRef do her thing. π«Ά
π METHODS π
every single one of these is an override β she's not inventing new methods, she's taking the standard ones and making them work with the glob-ref situation. here's the full roster, fr fr:
<<override>>create_instance() : Objectβ overridden, returns anObject.<<override>>clone_instance( instance : Object ) : Objectβ overridden, takes an instance and hands back anObject.<<override>>get_slot_value( instance : Object, slot_name : Str ) : Anyβ overridden, takes an instance and a slot_name, returnsAny.<<override>>set_slot_value( instance : Object, slot_name : Str, value : Any ) : Anyβ overridden, takes an instance, a slot_name and a value, returnsAny.<<override>>deinitialize_slot( instance : Object, slot_name : Str ) : Anyβ overridden, takes an instance and a slot_name, returnsAny.<<override>>is_slot_initialized( instance : Object, slot_name : Str ) : Boolβ overridden, takes an instance and a slot_name, returns aBool.<<override>>weaken_slot_value( instance : Object, slot_name : Str )β overridden, takes an instance and a slot_name.<<override>>inline_create_instance( class_variable : Str ) : Strβ overridden, takes a class_variable, returns aStr.<<override>>inline_slot_access( instance_variable : Str, slot_name : Str ) : Strβ overridden, takes an instance_variable and a slot_name, returns aStr.
and what do all of these have in common? they're the methods overridden by this class. periodt. π
π¦ SEE ALSO π¦
go read these next, they're the friend group:
MooseX::GlobRefMoose::Meta::InstanceMoose
π AUTHOR π
Piotr Roszatycki <dexter@cpan.org> β legend behavior, honestly. π
β LICENSE β
Copyright (c) 2007, 2008, 2009, 2010 Piotr Roszatycki <dexter@cpan.org>.
This is free software; you can redistribute it and/or modify it under the same terms as perl itself.
See <http://dev.perl.org/licenses/artistic.html>
π bestie reminder: that copyright line has four years in it β 2007, 2008, 2009, and 2010. don't skip one, she'll know.
and that's the whole page, you're welcome. this was perl v5.42.0, dated 2025-07-25, and honestly? iconic of her to still be serving this hard. mwah. ππβ¨πΈπ¦π
π¦ where this page comes from
- fedora 43: perl-MooseX-GlobRef 0.0701-41.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms