MooX::R...uggable(3)
π MooX::Roles::Pluggable π
okay bestie, welcome to MooX::Roles::Pluggable β the Moo eXtension for pluggable roles β¨ (yes that's the whole NAME section, she's brief but she's iconic).
β¨ SYNOPSIS β¨
package MyPackage;
use Moo;
sub foo { ... }
use MooX::Roles::Pluggable search_path => 'MyPackage::Role';
package MyPackage::Role::Bar;
use Moo::Role;
around foo => sub {
...
};
1;
see how cute that is?? that's the whole vibe right there π«Ά
πΈ DESCRIPTION πΈ
So basically: this module lets a class consume a whole bunch of roles based on rules you hand over to Module::Pluggable::Object. rules go in, roles come out, that's the tea.
The big brain idea here is that your plugins are roles, and they attach themselves using Moo(se)'s around, before and behind sugar. like, they just show up and rearrange your method calls. main character energy fr fr π
Everything you pass to import gets redirected straight to Module::Pluggable::Object, and here are the defaults it uses (unless you say otherwise, obvs):
search_pathβ the default search path is${caller}::Role. so if you don't tell it where to look, it just goes "yeah your role's probably in there" πrequireβ the default forrequireis1.
π¨ USE WITH CAUTION π¨
ngl bestie, listen to me: using a module like this β one that automatically injects code into your existing, running, and (hopefully) well tested programs and/or modules β can be dangerous and should be avoided whenever possible. that's not me being dramatic, that's the manpage being dramatic. respect it π
π¦ USE ANYWAY π¦
BUT. on the other hand π«Ά β when you're already letting plugins get loaded by your code, it's probably faster compiling the chain of responsibility once than doing it at runtime again and again. and plugins are changing the behaviour of your code anyway, so like... that's the whole point. When that's the intension, this is your module. periodt. π
π AUTHOR π
Jens Rehsack, "<rehsack at cpan.org>" β say thank you to Jens π
π BUGS π
found a bug? got a feature request? Please report any bugs or feature requests to "bug-moox-roles-pluggable at rt.cpan.org", or through the web interface at:
<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooX-Roles-Pluggable>
I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. mutual notification pipeline, we love to see it β¨
π SUPPORT π
You can find documentation for this module with the perldoc command.
perldoc MooX::Roles::Pluggable
You can also look for information at:
- RT: CPAN's request tracker (report bugs here)
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooX-Roles-Pluggable>
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/MooX-Roles-Pluggable>
- CPAN Ratings
<http://cpanratings.perl.org/d/MooX-Roles-Pluggable>
- Search CPAN
<http://search.cpan.org/dist/MooX-Roles-Pluggable/>
π§ ACKNOWLEDGEMENTS π§
(yeah bestie this section is literally empty in the original. she's mysterious. she said nothing and left. lowkey iconic π)
π LICENSE AND COPYRIGHT π
Copyright 2013-2015 Jens Rehsack.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See <http://dev.perl.org/licenses/> for more information.
and that's the whole page, bestie!! this was documented with perl v5.42.0 on 2025-07-25, so if you're reading this from the future, hi, hope the vibes held up ππΈβ slay, go write some pluggable roles, and remember: caution first, cuteness always π
β¨
π¦ where this page comes from
- fedora 43: perl-MooX-Roles-Pluggable 0.003-31.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