Perl Diver 2.33
Main Environment Variables Perl Default Values Perl Config - Summary Perl Config - Full Installed Modules List Directory uptime Docs

Module Documentation
Details and documentation about a specific module, including version and documentation (if available). Note that while links to perldoc.com and search.cpan.org are provided, the module may be part of a larger distribution. If you reach a File Not Found page on either site, please try the parent module.

Mouse::Spec

Name Mouse::Spec
Version v2.5.10
Located at /usr/lib/x86_64-linux-gnu/perl5/5.34
File /usr/lib/x86_64-linux-gnu/perl5/5.34/Mouse/Spec.pm
Is Core No
Search CPAN for this module Mouse::Spec
Documentation Mouse::Spec
Module Details Mouse::Spec


NAME

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


VERSION

This document describes Mouse version v2.5.10


SYNOPSIS

    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 document describes to what extend Mouse is compatible (and incompatible) with Moose.

Compatibility with Moose

Sugary APIs

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.

Meta object protocols

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. Don not make metaclasses immutable.

Mouse::Meta::Instance

Meta instance mechanism is not implemented, so you cannot change the reftype of Mouse objects in the same way as Moose.

Role exclusion

Role exclusion, exclude(), is not implemented.

-metaclass in Mouse::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 the MouseX::NativeTraits manpage for details.

Notes about Moose::Cookbook

Many recipes in the Moose::Cookbook manpage fit Mouse, including:


SEE ALSO

Mouse

Moose

the Moose::Manual manpage

the Moose::Cookbook manpage

Perl Diver brought to you by ScriptSolutions.com © 1997- 2026