MooseX...::With(3pm)
π MooseX::Declare::Syntax::Keyword::With β the vibe check π
okay bestie, so this is a page from the User Contributed Perl Documentation for MooseX::Declare::Syntax::Keyword::With, and it's literally about applying roles inside a class- or role-body. it's giving "small module, big personality", and you're gonna eat it up. π
β¨ NAME β¨
MooseX::Declare::Syntax::Keyword::With β apply roles within a class- or role-body. no cap, that's the whole job description. π
πΈ VERSION πΈ
version 0.43 β that's the one, that's the number, don't @ me.
π¦ SYNOPSIS π¦
look at this iconic little snippet:
use MooseX::Declare;
class ::Baz {
with 'Qux';
...
}
that's it. that's the whole thing. the with is doing the heavy lifting and it's serving. π
π DESCRIPTION π
so the with keyword lets you apply roles to the local class or role. it's not like the with-option on the class and role keywords β and the difference is lowkey the whole point: this one applies the roles immediately, instead of deferring application until the end of the class- or role-definition. instant gratification, main character energy, periodt. β
it also differs slightly from the with that Moose itself provides, because this one expands relative role names (like ::Foo) according to the current namespace. so if your role name is feeling shy and only gave you the short version, this keyword will fill in the rest. π§
π METHODS π
π₯ parse π₯
Object->parse(Object $context)
what it does: it will skip the declarator, and then make the with invocation apply the set of specified roles β but only after any possible namespace-expanding has happened. so: expand first, apply second, slay always. β¨
π«Ά CONSUMES π«Ά
MooseX::Declare::Syntax::KeywordHandling
yeah it eats that one. it's a whole meal. π
π SEE ALSO π
MooseX::DeclareMooseX::Declare::Syntax::Keyword::Namespace
go read those too, bestie, they're part of the lore. iykyk. π
π AUTHOR π
Florian Ragwitz <rafl@debian.org>
the legend himself. we stan. π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2008 by Florian Ragwitz.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
(translation: it's free, go wild, just keep the same terms as Perl 5 itself. legal stuff, but make it cute. π¦)
and that's the whole page, no notes. the docs were generated byperl v5.34.0on2022-06-15, so shoutout to that version and that date for bringing us this absolute gem. bye bestie, go apply some roles immediately πβ¨πΈ
π¦ where this page comes from
- debian bookworm: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-declare-perl 0.43-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms