mop::traits - collection of traits for the mop
This package contains the core traits provided by the mop.
rw
When applied to an attribute this will generate a read/write accessor for that attribute.
It has no effect if it is applied to classes or methods.
ro
When applied to an attribute this will generate a read-only accessor for that attribute.
This will throw an exception if it is applied to classes or methods.
required
When applied to an attribute this will result in a requirement that a value for this attribute be supplied via the constructor at instance creation time.
This will throw an exception if the attribute already has a default value associated with it.
weak_ref
When applied to an attribute this will result in the weakening of any value stored there.
lazy
When applied to an attribute this will result in the deferred initialization of the default value of this attribute.
abstract
When applied to a class this will mark the class as being abstract. It is required to use this trait if your class has any required methods in it.
This will throw an exception if it is applied to attributes or methods.
overload($operator)
When applied to a method this will use Perl's built in operator overloading to associate this method with the specified $operator. For more information about what kind of overload behaviors are supported see the overload module documentation.
$operator
This will throw an exception if it is applied to classes or attributes.
extending_non_mop
When applied to a class, whose superclass is a non-MOP class, this will attempt to ensure that both the superclass's constructor is called as well as the necessary initialization of the MOP class. Note that this is a temporary measure until we can make this Just Work automatically.
repr($ref_type)
When applied to a class this will use the specified $ref_type as the underlying instance type for all instances of the class. Currently supported reference types are SCALAR, ARRAY, HASH and GLOB, and must be passed as a string literal. If a CODE reference is passed, it will be directly used by the mop to generate new instances.
$ref_type
Since this module is still under development we would prefer to not use the RT bug queue and instead use the built in issue tracker on Github.
Stevan Little <stevan.little@iinteractive.com>
Jesse Luehrs <doy@tozt.net>
Florian Ragwitz <rafl@debian.org>
This software is copyright (c) 2013-2014 by Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install mop, copy and paste the appropriate command in to your terminal.
cpanm
cpanm mop
CPAN shell
perl -MCPAN -e shell install mop
For more information on module installation, please visit the detailed CPAN module installation guide.