MooX::R...uggable(3)

πŸ“¦ version 0.003, in fedora 43

πŸ’– 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 for require is 1.

🚨 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 πŸ™ˆ)


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