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
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.
Change the way Perl modules are installed, update the default Perl to 5.18.
Before, we had:
site_perl : lib/perl5/site_perl/5.18
site_perl/perl_arch : lib/perl5/site_perl/5.18/mach
perl_man3 : lib/perl5/5.18/man/man3
Now we have:
site_perl : lib/perl5/site_perl
site_arch : lib/perl5/site_perl/mach/5.18
perl_man3 : lib/perl5/site_perl/man/man3
Modules without any .so will be installed at the same place regardless of the
(Only the first 15 lines of the commit message are shown above )