Roles are composable units of behavior. They are useful for factoring
out functionality common to many classes from any part of your class
hierarchy. See Moose::Cookbook::Roles::Recipe1 for an introduction to
Moose::Role.
While combining roles affords you a great deal of flexibility,
individual roles have very little in the way of configurability. Core
Moose provides alias for renaming methods and excludes for ignoring
methods. These options are primarily (perhaps solely) for
disambiguating role conflicts. See Moose::Cookbook::Roles::Recipe2 for
more about alias and excludes.
Because roles serve many different masters, they usually provide only
the least common denominator of functionality. To empower roles
further, more configurability than alias and excludes is required.
Perhaps your role needs to know which method to call when it is done.
Or what default value to use for its url attribute.
Parameterized roles offer exactly this solution.
When using Moose::Role, a class which provides a method a role provides will
silently override that method. This can cause strange, hard-to-debug errors when
the role's methods are not called. Simple use MooseX::Role::Strict instead of
Moose::Role and overriding a role's method becomes a composition-time failure.
See the synopsis for a resolution.
MooseX::Role::WithOverloading allows you to write a Moose::Role which
defines overloaded operators and allows those operator overloadings
to be composed into the classes/roles/instances it's compiled to,
while plain Moose::Roles would lose the overloading.
MooseX::Runnable is a framework for making classes runnable applications. This
role doesn't do anything other than tell the rest of the framework that your
class is a runnable application that has a "run" method which accepts arguments
and returns the process' exit code.
This is a convention that the community has been using for a while. This role
tells the computer that your class uses this convention, and let's the computer
abstract away some of the tedium this entails.
This module does not provide any methods. Simply loading it changes the default
naming policy for the loading class so that accessors are separated into get
and set methods. The get methods have the same name as the accessor, while set
methods are prefixed with "set_".
The 'SetOnce' attribute lets your class have attributes that are not lazy and
not set, but that cannot be altered once set. If you try to alter the value
of an attribute with the SetOnce trait, either by accessor or writer, and the
attribute has a value, it will throw an exception.
This role loads simple configfiles to set object attributes. It is
based on the abstract role MooseX::ConfigFromFile, and uses Config::Any
to load your configfile. Config::Any will in turn support any of a
variety of different config formats, detected by the file extension.
See Config::Any for more details about supported formats.
MooseX::Singleton lets you easily upgrade (or downgrade, as it were)
your Moose class to a singleton.
MooseX::Storage is a serialization framework for Moose, it provides a very
flexible and highly pluggable way to serialize Moose classes to a number of
different formats and styles.
Multiplex::CMD is a Perl module which can be helpful for running some commands
for many hosts.