Mouse::Spec(3pm)
Okay bestie, welcome to Mouse::Spec(3pm) from the User Contributed Perl Documentation β it's the compatibility receipt for Mouse vs Moose. Let's get into the group chat π β¨
π NAME π
Mouse::Spec β To what extent Mouse is compatible with Moose.
β¨ VERSION β¨
This document describes Mouse version v2.6.2 β yes, that exact version, no cap.
π§ SYNOPSIS π§
Run this little icon:
use Mouse::Spec;
printf "Mouse/%s is compatible with Moose/%s\n",
Mouse::Spec->MouseVersion, Mouse::Spec->MooseVersion;
π¦ DESCRIPTION π¦
Mouse is a subset of Moose. This doc is here to tell you to what extent Mouse is compatible (and incompatible) with Moose. Buckle up π
π¬ Compatibility with Moose π¬
Sugary APIs
The sugary APIs are highly compatible with Moose. Methods that have the same name as Moose's are expected to be compatible with Moose's. Slay.
Meta object protocols
Meta object protocols are a subset of the counterpart of Moose. Their methods that have the same name as Moose's are expected to be compatible with Moose's. Feel free to use these methods even if they're not documented β yes, even the undocumented ones, iykyk.
However, there are differences between Moose's MOP and Mouse's. For example, meta object protocols in Mouse have no attributes by default, so $metaclass->meta->make_immutable() will not work as you expect. Do not make metaclasses immutable β the original page says βDon not make metaclasses immutable,β and either way the warning stands π.
Mouse::Meta::Instance
Meta instance mechanism is not implemented, so you cannot change the reftype of Mouse objects in the same way as Moose. No cap, that's just not a thing here.
Role exclusion
Role exclusion, exclude(), is not implemented. It's giving βwe don't have that.β
-metaclass in Mouse::Exporter
use Mouse -metaclass => ... are not implemented. Use use Mouse -traits => ... instead. That's the move π
Mouse::Meta::Attribute::Native
Native traits are not supported directly, but MouseX::NativeTraits is available on CPAN. Once you have installed it, you can use it as the same way in Moose. That is, native traits are automatically loaded by Mouse.
See MouseX::NativeTraits for details. Obsessed.
π Notes about Moose::Cookbook π
Many recipes in Moose::Cookbook fit Mouse, including:
Moose::Cookbook::Basics::Recipe1β The (always classic) Point exampleMoose::Cookbook::Basics::Recipe2β A simple BankAccount exampleMoose::Cookbook::Basics::Recipe3β A lazy BinaryTree exampleMoose::Cookbook::Basics::Recipe4β Subtypes, and modeling a simple Company class hierarchyMoose::Cookbook::Basics::Recipe5β More subtypes, coercion in a Request classMoose::Cookbook::Basics::Recipe6β The augment/inner exampleMoose::Cookbook::Basics::Recipe7β Making Moose fast with immutableMoose::Cookbook::Basics::Recipe8β Builder methods and lazy_buildMoose::Cookbook::Basics::Recipe9β Operator overloading, subtypes, and coercionMoose::Cookbook::Basics::Recipe10β Using BUILDARGS and BUILD to hook into object constructionMoose::Cookbook::Roles::Recipe1β The Moose::Role exampleMoose::Cookbook::Roles::Recipe2β Advanced Role Composition - method exclusion and aliasingMoose::Cookbook::Roles::Recipe3β Applying a role to an object instanceMoose::Cookbook::Meta::Recipe2β A meta-attribute, attributes with labelsMoose::Cookbook::Meta::Recipe3β Labels implemented via attribute traitsMoose::Cookbook::Extending::Recipe3β Providing an alternate base object class
π SEE ALSO π
Go peek at these:
MouseMooseMoose::ManualMoose::Cookbook
π That's the teaaa, bestie: this page came from perl v5.42.2 on 2026-04-21. Stay iconic! π
π¦ where this page comes from
- alpine 3.24: perl-mouse-doc 2.6.2-r0 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms