You can define multimethods with the "multi" declarator:
use Class::Multimethods::Pure;
multi collide => ('Bullet', 'Ship') => sub {
my ($a, $b) = @_; ...
};
multi collide => ('Ship', 'Asteroid') => sub {
my ($a, $b) = @_; ...
};
It is usually wise to put such declarations within a BEGIN block, so
they behave more like Perl treats subs (you can call them without
parentheses and you can use them before you define them).
Add Catalyst-Style Config To Your Class
Class::Load::XS provides an XS implementation for portions of Class::Load. See
Class::Load for API details.
Class::Method::Modifiers::Fast provides three modifiers: before,
around, and after. before and after are run just before and after the
method they modify, but can not really affect that original method.
around is run in place of the original method, with a hook to easily
call that original method. See the MODIFIERS section for more details
on how the particular modifiers work.
Method modifiers are a powerful feature from the CLOS (Common Lisp Object
System) world.
In its most basic form, a method modifier is just a method that calls
$self->SUPER::foo(@_). I for one have trouble remembering that exact
invocation, so my classes seldom re-dispatch to their base classes. Very bad!
Class::Method::Modifiers provides three modifiers: before, around, and after.
before and after are run just before and after the method they modify, but can
not really affect that original method. around is run in place of the original
method, with a hook to easily call that original method.
One clear benefit of using Class::Method::Modifiers is that you can define
multiple modifiers in a single namespace. These separate modifiers don't need
to know about each other. This makes top-down design easy. Have a base class
that provides the skeleton methods of each operation, and have plugins modify
those methods to flesh out the specifics.
In short, Class::Method::Modifiers solves the problem of making sure you call
$self->SUPER::foo(@_), and provides a cleaner interface for it.
Class::ObjectTemplate::DB extends Class::ObjectTemplate in one
simple way: the undefined() method.
The author finds this useful when representing classes based on
objects stored in databases (hence the name of the module).
That way an object can be created, without triggering a DB lookup.
Later if data is accessed and it is not currently present in the object,
it can be retrieved on an as-need basis.
This package provides a framework for rapid Object Oriented Perl
application development. It consists of a number of base classes that are
similar to the C++/STL framework, plus a number of helper classes which
provide the glue to transparently generate common functions, and will
enable you to put your Perl application together very quickly.
This module provides a faster but less secure version of Class::Std.
This module provides three utility subroutines that simplify the creation of
"inside-out" classes. See Chapters 15 and 16 of "Perl Best Practices" (O'Reilly,
2005) for details.
Config::INI::Simple is for very simplistic reading and writing of INI files. A
new object must be created for each INI file (an object keeps all the data read
in from an INI which is used on the write method to write to the INI). It also
keeps all your comments and original order intact.