MooseX...andling(3pm)
β¨ MooseX::Declare::Syntax::OptionHandling π
okay bestie, welcome to MooseX::Declare::Syntax::OptionHandling β it's the option parser dispatching situation, and honestly? it's giving traffic controller but make it Perl. π
This is part of the User Contributed Perl Documentation and it's sitting at version 0.43. slay.
πΈ DESCRIPTION πΈ
so here's the vibe: this role is the little matchmaker of the option world. for every foo option it discovers, it goes and calls a method literally named add_foo_option_customization. like, it sees the option, it finds the handler, it connects them. matchmaker, matchmaker, make me a match. π
that's it. that's the whole job. and it ate. π₯
π¦ METHODS π¦
ignored_options
List[Str] Object->ignored_options ()
this one hands you back a list of option names that won't get dispatched. like the VIP list but inverted β these options do NOT get the matchmaker treatment, no cap.
and what's on the list by default? just the is option. that's it. is is the only one sitting in the no-fly zone by default. π
π REQUIRED METHODS π
get_identifier
Str Object->get_identifier ()
bestie you must implement this one, it's not optional, it's required, periodt. it needs to return the name of the current keyword's identifier. that's the whole assignment. no identifier, no vibes. π
π MODIFIED METHODS π
add_optional_customizations
Object->add_optional_customizations (Object $context, Str $package, HashRef $options)
here's where the magic happens, fr fr. this one dispatches out to the respective add_*_option_customization method so your options actually get handled. the asterisk is doing a lot of work there and it's iconic for it. β
but plot twist β unless the option is listed in the ignored_options. yeah. if it's on the ignore list it gets skipped, no dispatch, no customization, nothing. the bouncer said not tonight. π
π§ SEE ALSO π§
- MooseX::Declare
- MooseX::Declare::Syntax::NamespaceHandling
go read those too, iykyk. π«Ά
π AUTHOR π
Florian Ragwitz <rafl@debian.org> β thank you for your service king π
π 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. so like, go wild but respectfully. πΈ
and that's the whole page bestie, we did it π₯³
perl v5.34.0 Β· 2022-06-15 β mwah, that's the version and the date this little doc was born, and honestly it still serves. bye pookie πβ¨
π¦ 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