Mo::Features(3)
πΈ Mo Features πΈ
okay bestie, listen β this page is all about Mo::Features(3), and it's genuinely one of my faves because it's giving glow-up energy for a module that's literally described as absolutely minimal. π
Mo is, like, the tiniest little guy. But the way that it lets you just add features whenever you want? Iconic. No cap. You do it like this:
use Mo qw[default builder other features];
And that's it. That loads the modules Mo::default, etc. etc. etc., and then they all just roll up and modify your Mo reality. π¦
β¨ the feature modules that ship with Mo β¨
Here's the full current lineup, no skips, no cuts:
Mo::builderβ adds thebuilderfeature tohas. πMo::chainβ adds thechainfeature tohas.Mo::coerceβ adds thecoercefeature tohas.Mo::defaultβ adds thedefaultfeature tohas.Mo::exporterβ an Exporter forMo::Inlineusage. Heads up though: it only works with inlined Mo. πMo::importβ a Finalizer forMo::Inlineusage. Same deal: only works with inlined Mo.Mo::isβ adds theisfeature tohas.Mo::Mooseβ uses Moose in place of Mo for everything. π³Mo::Mouseβ uses Mouse in place of Mo for everything.Mo::optionβ adds theoptionfeature tohas.Mo::requiredβ adds therequiredfeature tohas.Mo::xsβ uses XS modules to make things faster. π₯ RequiresClass::XSAccessor.
π and there's more (CPAN girlies rise) π
There are also feature modules that ship outside of the Mo distribution. You can go search CPAN yourself, but here's a lil starter list to get you going:
Mo::xxxβ exports theXXXfunctions for debugging. Handy! β
β οΈ NOTE β οΈ
Okay so do NOT just assume that every feature module is gonna play nice with every other feature module. Sometimes the order you list them in actually changes how they work together. π Read the feature docs, and test your assumptions, bestie. Fr fr.
We keep making more and more things work together, and when they don't, we try to document it. So if you feel like something critical is broken, let us know. See Mo::Hacking. π«Ά
mwah, that's a wrap β this was Mo::Features(3), brought to you by perl v5.42.0 on 2025-07-25. Stay slay, test your features, and don't forget to read the docs. πβ¨π
π¦ where this page comes from
- fedora 43: perl-Mo 0.40-28.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