logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Mouse::Spec - To what extent Mouse is compatible with Moose

Description

Mouse is a subset of Moose. This document describes to what extend Mouse is compatible (and incompatible) with Moose. CompatibilitywithMooseSugaryAPIs The sugary APIs are highly compatible with Moose. Methods which have the same name as Moose's are expected to be compatible with Moose's. Metaobjectprotocols Meta object protocols are a subset of the counterpart of Moose. Their methods which have the same name as Moose's are expected to be compatible with Moose's. Feel free to use these methods even if they are not documented. 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. Donnotmakemetaclassesimmutable. Mouse::Meta::Instance Meta instance mechanism is not implemented, so you cannot change the reftype of Mouse objects in the same way as Moose. Roleexclusion Role exclusion, exclude(), is not implemented. -metaclassinMouse::Exporter "use Mouse -metaclass => ..." are not implemented. Use "use Mouse -traits => ..." instead. 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. NotesaboutMoose::Cookbook Many recipes in Moose::Cookbook fit Mouse, including: • Moose::Cookbook::Basics::Recipe1 - The (always classic) Point example • Moose::Cookbook::Basics::Recipe2 - A simple BankAccount example • Moose::Cookbook::Basics::Recipe3 - A lazy BinaryTree example • Moose::Cookbook::Basics::Recipe4 - Subtypes, and modeling a simple Company class hierarchy • Moose::Cookbook::Basics::Recipe5 - More subtypes, coercion in a Request class • Moose::Cookbook::Basics::Recipe6 - The augment/inner example • Moose::Cookbook::Basics::Recipe7 - Making Moose fast with immutable • Moose::Cookbook::Basics::Recipe8 - Builder methods and lazy_build • Moose::Cookbook::Basics::Recipe9 - Operator overloading, subtypes, and coercion • Moose::Cookbook::Basics::Recipe10 - Using BUILDARGS and BUILD to hook into object construction • Moose::Cookbook::Roles::Recipe1 - The Moose::Role example • Moose::Cookbook::Roles::Recipe2 - Advanced Role Composition - method exclusion and aliasing • Moose::Cookbook::Roles::Recipe3 - Applying a role to an object instance • Moose::Cookbook::Meta::Recipe2 - A meta-attribute, attributes with labels • Moose::Cookbook::Meta::Recipe3 - Labels implemented via attribute traits • Moose::Cookbook::Extending::Recipe3 - Providing an alternate base object class

Name

Mouse::Spec - To what extent Mouse is compatible with Moose

See Also

Mouse Moose Moose::Manual Moose::Cookbook perl v5.40.0 2024-10-20 Mouse::Spec(3pm)

Synopsis

use Mouse::Spec; printf "Mouse/%s is compatible with Moose/%s\n", Mouse::Spec->MouseVersion, Mouse::Spec->MooseVersion;

Version

This document describes Mouse version v2.5.11

See Also