Class::HasA - Automatically create has-a relationships
package Some::Mail::Thing; use Class::HasA ( [ qw/from to subject/ ] => "head" ); # Equivalent: # sub from { shift->head->from(@_) } # sub to { shift->head->to(@_) } # ...
This module produces methods which encapsulates has-a relationships between objects. For instance, in the example above, a mail message has-a head object, and the from, to and subject methods act "through" the head object.
head
from
to
subject
Simon Cozens, <simon@kasei.com>
Copyright 2003 by Kasei
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Class::HasA, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::HasA
CPAN shell
perl -MCPAN -e shell install Class::HasA
For more information on module installation, please visit the detailed CPAN module installation guide.