MooseX...loading(3pm)
π MooseX::Role::WithOverloading β yeah that's the manual name, it's a mouthful, we know
okay so bestie, grab a boba, because we're talking about MooseX::Role::WithOverloading β the Perl module (from the User Contributed Perl Documentation, no less) that lets your roles do overload things. And yes, it's DEPRECATED, we'll get to that, don't panic. π«Ά
β¨ NAME β¨
MooseX::Role::WithOverloading β (DEPRECATED) Roles which support overloading. periodt.
πΈ VERSION πΈ
version 0.17 π
π¦ SYNOPSIS π¦
okay here's the vibe, literally copy-paste this energy:
package MyRole;
use MooseX::Role::WithOverloading;
use overload
q{""} => 'as_string',
fallback => 1;
has message => (
is => 'rw',
isa => 'Str',
);
sub as_string { shift->message }
package MyClass;
use Moose;
use namespace::autoclean;
with 'MyRole';
package main;
my $i = MyClass->new( message => 'foobar' );
print $i; # Prints 'foobar'
like. it prints foobar. slay. π₯
π DESCRIPTION π
So MooseX::Role::WithOverloading lets you write a Moose::Role that defines overloaded operators, and it lets those overload methods get composed into the classes/roles/instances it's compiled to β which is the whole point, because plain Moose::Roles would just lose the overloading. π tragic. not on our watch.
Now here's the tea: starting with Moose version 2.1300, this module is no longer necessary, because that functionality is available already. In that case, use MooseX::Role::WithOverloading behaves identically to use Moose::Role. same energy, no extra module. π
π DEPRECATION NOTICE π
This module is marked as deprecated, because starting with Moose version 2.1300, the functionality provided here is now built-in to Moose. You only need to use this module if you are using an older Moose (but please upgrade!). π§
fr fr, upgrade. the old Moose is not the moment.
π SUPPORT π
Bugs may be submitted through the RT bug tracker <https://rt.cpan.org/Public/Dist/Display.html?Name=MooseX-Role-WithOverloading> (or bug-MooseX-Role-WithOverloading@rt.cpan.org <mailto:bug-MooseX-Role-WithOverloading@rt.cpan.org>).
There is also a mailing list available for users of this distribution, at <http://lists.perl.org/list/moose.html>. π
There is also an irc channel available for users of this distribution, at irc://irc.perl.org/#moose. come say hi, it's giving community. π
π«Ά AUTHORS π«Ά
- Florian Ragwitz
<rafl@debian.org>β¨ - Tomas Doran
<bobtfish@bobtfish.net>β¨
π CONTRIBUTORS π
- Karen Etheridge
<ether@cpan.org>π - Dave Rolsky
<autarch@urth.org>π - Jesse Luehrs
<doy@tozt.net>π - Tomas Doran (t0m)
<t0m@state51.co.uk>π
π COPYRIGHT AND LICENCE π
This software is copyright (c) 2009 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. πͺ
and that's the whole page bestie, no notes, we ate. this was MooseX...loading(3pm) from the User Contributed Perl Documentation, version perl v5.42.3, dated 2026-08-22 β mwah, iconic, byeee ππ
π¦ where this page comes from
- ubuntu stonking: libmoosex-role-withoverloading-perl 0.17-3build6 Β· 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