The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Changes for version 0.58

  • !! This release has an incompatible change regarding !! !! how roles add methods to a class !!
  • Roles and role application ! Roles now add methods by calling add_method, not alias_method. They make sure to always provide a method object, which will be cloned internally. This means that it is now possible to track the source of a method provided by a role, and even follow its history through intermediate roles.
    • This means that methods added by a role now show up when looking at a class's method list/map. (Dave Rolsky)
  • Makefile.PL
    • From this release on, we'll try to maintain a list of conflicting modules, and warn you if you have one installed. For example, this release conflicts with ...
      • MooseX::Singleton <= 0.11
      • MooseX::Params::Validate <= 0.05
      • Fey::ORM <= 0.10
      • In general, we try to not break backwards compatibility for most Moose users, but MooseX modules and other code which extends Moose's metaclasses is often affected by very small changes in the Moose internals.
  • Moose::Meta::Method::Delegation
  • Moose::Meta::Attribute
    • Delegation methods now have their own method class. (Dave Rolsky)
  • Moose::Meta::TypeConstraint::Parameterizable
    • Added a new method 'parameterize' which is basically a factory for the containing constraint. This makes it easier to create new types of parameterized constraints. (jnapiorkowski)
  • Moose::Meta::TypeConstraint::Union
    • Changed the way Union types canonicalize their names to follow the normalized TC naming rules, which means we strip all whitespace. (jnapiorkowski)
  • Moose::Util::TypeConstraints
    • Parameter and Union args are now sorted, this makes Int|Str the same constraint as Str|Int. (jnapiorkowski)
    • Changes to the way Union types are parsed to more correctly stringify their names. (jnapiorkowski)
    • When creating a parameterized type, we now use the new parameterize method. (jnapiorkowski)
    • Incoming type constraint strings are now normalized to remove all whitespace differences. (jnapiorkowski)
    • Changed the way we parse type constraint strings so that we now match TC[Int,Int,...] and TC[name=>Str] as parameterized type constraints. This lays the foundation for more flexible type constraint implementations.
  • Tests and docs for all the above. (jnapiorkowski)
  • Moose::Exporter
  • Moose
    • Moose::Exporter will no longer remove a subroutine that the exporting package re-exports. Moose re-exports the Carp::confess function, among others. The reasoning is that we cannot know whether you have also explicitly imported those functions for your own use, so we err on the safe side and always keep them. (Dave Rolsky)
      • added tests for this (rafl)
  • Moose::Meta::Class
    • Changes to how we fix metaclass compatibility that are much too complicated to go into. The summary is that Moose is much less likely to complain about metaclass incompatibility now. In particular, if two metaclasses differ because Moose::Util::MetaRole was used on the two corresponding classes, then the difference in roles is reconciled for the subclass's metaclass. (Dave Rolsky)
    • Squashed an warning in _process_attribute (thepler)
  • Moose::Meta::Role
    • throw exceptions (sooner) for invalid attribute names (thepler)
      • added tests for this (thepler)
  • Moose::Util::MetaRole
    • If you explicitly set a constructor or destructor class for a metaclass object, and then applied roles to the metaclass, that explicitly set class would be lost and replaced with the default.
  • Moose::Meta::Class
  • Moose::Meta::Attribute
  • Moose::Meta::Method
  • Moose
  • Moose::Object
  • Moose::Error::Default
  • Moose::Error::Croak
  • Moose::Error::Confess
    • All instances of confess() changed to use overridable C<throw_error> method. This method ultimately calls a class constructor, and you can change the class being called. In addition, errors now pass more information than just a string. The default C<error_class> behaves like C<Carp::confess>, so the behavior is not visibly different for end users.

Documentation

How to cook a Moose
The (always classic) Point example.
Operator overloading, subtypes, and coercion
A simple BankAccount example
A lazy BinaryTree example
Subtypes, and modeling a simple Company class hierarchy
More subtypes, coercion in a Request class
The augment/inner example
Making Moose fast with immutable
Builder methods and lazy_build
Moose extension overview
Providing a role for the base object class
Providing an alternate base object class
Acting like Moose.pm and providing sugar Moose-style
Frequently asked questions about Moose
Welcome to the meta world (Why Go Meta?)
A meta-attribute, attributes with labels
Labels implemented via attribute traits
Adding a "table" attribute to the metaclass
The "table" attribute as a metaclass trait
The Moose::Role example
Advanced Role Composition - method exclusion and aliasing
Restricted keywords in Moose
Snippets of code for using Types and Type Constraints
The latest in trendy Moose cuisine
For when things go wrong with Moose
What is Moose, and how do I use it?
Formal spec for Role behavior
Moose idioms in plain old Perl 5 without the sugar

Modules

A postmodern object system for Perl 5
Prefer confess
Prefer croak
Carp based error generation for Moose.
make an import() and unimport() just like Moose.pm
The Moose attribute metaclass
The Moose metaclass
The Moose Instance metaclass
A Moose Method metaclass
A Moose Method metaclass for accessors
A Moose Method metaclass for augmented methods
Method Meta Object for constructors
A Moose Method metaclass for delegation methods
Method Meta Object for destructors
A Moose Method metaclass for overriden methods
The Moose Role metaclass
A base class for role application
Compose a role into a class
Compose a role into an instance
Compose a role into another role
An object to represent the set of roles
A Moose Method metaclass for Roles
A Moose metaclass for required methods in Roles
The Moose Type Coercion metaclass
The Moose Type Coercion metaclass for Unions
The Moose Type Constraint metaclass
Class/TypeConstraint parallel hierarchy
Type constraint for enumerated values.
Higher Order type constraints for Moose
Higher Order type constraints for Moose
registry for type constraints
Role/TypeConstraint parallel hierarchy
A union of Moose type constraints
The base object for Moose
The Moose Role
Utilities for working with Moose classes
Apply roles to any metaclass, as well as the object base class
Type constraint system for Moose
Optimized constraint bodies for various moose types
Test functions for Moose specific features
syntactic sugar to make Moose one-liners easier

Provides

in lib/Moose/Meta/Attribute.pm