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> πŸ’–

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