MooseX...Strict(3pm)
β¨ MooseX::Role::Strict(3pm) β¨
okay bestie, welcome to the MooseX...Strict(3pm) manual page, which is the documentation for MooseX::Role::Strict β aka use strict 'roles'. yes that's the whole vibe. let's get into it π
πΈ NAME πΈ
MooseX::Role::Strict β literally just use strict 'roles', no cap π«Ά
π VERSION π
Version 0.05 β¨
π SYNOPSIS π
okay so this code? this code will fail at composition time. it's giving chaos. not in a cute way. π
{
package My::Role;
use MooseX::Role::Strict;
sub conflict {}
}
{
package My::Class;
use Moose;
with 'My::Role';
sub conflict {}
}
and the error message you'll get is something like this:
The class My::Class has implicitly overridden the method (conflict) from
role My::Role ...
to resolve this, you explicitly exclude the 'conflict' method, like so π
{
package My::Class;
use Moose;
with 'My::Role' => { -excludes => [ 'conflict' ] };
sub conflict {}
}
π DESCRIPTION π
WARNING: this is ALPHA code. more features to be added later. she's still growing π
so here's the tea π: when you're using Moose::Role, if a class provides a method that a role also provides, the class will silently override that method. silently!! π and that can cause strange, hard-to-debug errors when the role's methods are not called. it's giving nightmare fuel ngl.
the fix is iconic and simple: just use MooseX::Role::Strict instead of Moose::Role, and overriding a role's method becomes a composition-time failure. no more sneaky business β¨. see the synopsis for a resolution, bestie.
π¦ AUTHOR π¦
Curtis "Ovid" Poe, "<ovid at cpan.org>" π
π BUGS π
please report any bugs or feature requests to "bug-moosex-role-strict at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=MooseX-Role-Strict. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. we love a feedback loop π«Ά
π§ SUPPORT π§
you can find documentation for this module with the perldoc command. main character move honestly:
perldoc MooseX::Role::Strict
you can also look for information at:
- RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=MooseX-Role-Strict
- AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/MooseX-Role-Strict
- CPAN Ratings
http://cpanratings.perl.org/d/MooseX-Role-Strict
- Search CPAN
http://search.cpan.org/dist/MooseX-Role-Strict/
π ACKNOWLEDGEMENTS π
β TODO β
add -includes to make things easier:
with 'Some::Role' => { -includes => 'bar' };
that reverses the sense of '-excludes' in case you're more interested in the interface than the implementation. I'm unsure of the syntax for auto-converting a role to a pure interface. π€·βοΈ (we'll figure it out bestie, someday)
π COPYRIGHT & LICENSE π
Copyright 2009 Curtis "Ovid" Poe, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
and that's the whole page, bestie!! π this was perl v5.34.0, dated 2022-06-15, from the MooseX...Strict(3pm) manual. slay, go write some roles, and remember: no silent overrides in this house π π periodt β¨π¦πΈ
π¦ where this page comes from
- debian bookworm: libmoosex-role-strict-perl 0.5-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libmoosex-role-strict-perl 0.5-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libmoosex-role-strict-perl 0.5-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libmoosex-role-strict-perl 0.5-3 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libmoosex-role-strict-perl 0.5-3 Β· 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