1Mouse::Spec(3)        User Contributed Perl Documentation       Mouse::Spec(3)
2
3
4

NAME

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

VERSION

9       This document describes Mouse version v2.5.10
10

SYNOPSIS

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

DESCRIPTION

18       Mouse is a subset of Moose. This document describes to what extend
19       Mouse is compatible (and incompatible) with Moose.
20
21   Compatibility with Moose
22       Sugary APIs
23
24       The sugary APIs are highly compatible with Moose. Methods which have
25       the same name as Moose's are expected to be compatible with Moose's.
26
27       Meta object protocols
28
29       Meta object protocols are a subset of the counterpart of Moose.  Their
30       methods which have the same name as Moose's are expected to be
31       compatible with Moose's. Feel free to use these methods even if they
32       are not documented.
33
34       However, there are differences between Moose's MOP and Mouse's.  For
35       example, meta object protocols in Mouse have no attributes by default,
36       so "$metaclass->meta->make_immutable()" will not work as you expect.
37       Don not make metaclasses immutable.
38
39       Mouse::Meta::Instance
40
41       Meta instance mechanism is not implemented, so you cannot change the
42       reftype of Mouse objects in the same way as Moose.
43
44       Role exclusion
45
46       Role exclusion, "exclude()", is not implemented.
47
48       -metaclass in Mouse::Exporter
49
50       "use Mouse -metaclass => ..." are not implemented.  Use "use Mouse
51       -traits => ..." instead.
52
53       Mouse::Meta::Attribute::Native
54
55       Native traits are not supported directly, but "MouseX::NativeTraits" is
56       available on CPAN. Once you have installed it, you can use it as the
57       same way in Moose. That is, native traits are automatically loaded by
58       Mouse.
59
60       See MouseX::NativeTraits for details.
61
62   Notes about Moose::Cookbook
63       Many recipes in Moose::Cookbook fit Mouse, including:
64
65       •   Moose::Cookbook::Basics::Recipe1 - The (always classic) Point
66           example
67
68       •   Moose::Cookbook::Basics::Recipe2 - A simple BankAccount example
69
70       •   Moose::Cookbook::Basics::Recipe3 - A lazy BinaryTree example
71
72       •   Moose::Cookbook::Basics::Recipe4 - Subtypes, and modeling a simple
73           Company class hierarchy
74
75       •   Moose::Cookbook::Basics::Recipe5 - More subtypes, coercion in a
76           Request class
77
78       •   Moose::Cookbook::Basics::Recipe6 - The augment/inner example
79
80       •   Moose::Cookbook::Basics::Recipe7 - Making Moose fast with immutable
81
82       •   Moose::Cookbook::Basics::Recipe8 - Builder methods and lazy_build
83
84       •   Moose::Cookbook::Basics::Recipe9 - Operator overloading, subtypes,
85           and coercion
86
87       •   Moose::Cookbook::Basics::Recipe10 - Using BUILDARGS and BUILD to
88           hook into object construction
89
90       •   Moose::Cookbook::Roles::Recipe1 - The Moose::Role example
91
92       •   Moose::Cookbook::Roles::Recipe2 - Advanced Role Composition -
93           method exclusion and aliasing
94
95       •   Moose::Cookbook::Roles::Recipe3 - Applying a role to an object
96           instance
97
98       •   Moose::Cookbook::Meta::Recipe2 - A meta-attribute, attributes with
99           labels
100
101       •   Moose::Cookbook::Meta::Recipe3 - Labels implemented via attribute
102           traits
103
104       •   Moose::Cookbook::Extending::Recipe3 - Providing an alternate base
105           object class
106

SEE ALSO

108       Mouse
109
110       Moose
111
112       Moose::Manual
113
114       Moose::Cookbook
115
116
117
118perl v5.32.1                      2021-01-27                    Mouse::Spec(3)
Impressum