"overriden attribute-names" are not dramatic, because every attribute gets its classname prepended like "Object::attribute" into the hash representation of the object. But you must be aware that when initializing via new( public => ), alwas the first parent attribute is used for the initalization. new( Parent1::field => 'bla', Parent2::field => 'blabla' );
Class::Maker - classes, reflection, schemas, serialization, attribute- and multiple inheritance
use Class::Maker qw(:all); class Something; class Person, { isa => [ 'Something' ], public => { scalar => [qw( name age internal )], }, private { int => [qw( internal )], }, }; sub Person::hello { my $this = shift; $this->_internal( 2123 ); # the private one printf "Here is %s and i am %d years old.\n", $this->name, $this->age; }; my $p = Person->new( name => Murat, age => 27 ); $p->hello;
This package descibes the default constructor functionality. It is central to Class::Maker because during its call reflection, initialization, inheritance gets handled.
Once this method exists in the package of the class it is called right after new() was dispatched. It is generally for the modification of the @_ arguments to a convinient way new() can handle it (It always expects a hash, but with this function one could translate an array to the hash).
@_
new()
<& /maslib/signatures.mas:author_as_pod, &>
To install Class::Maker, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Class::Maker
CPAN shell
perl -MCPAN -e shell install Class::Maker
For more information on module installation, please visit the detailed CPAN module installation guide.