package Foo; use base qw(Genelet::Accessor); Foo->setup_accessors( %init_hash );
By inheriting your class from Genelet::Accessor, or one of its children such as Genelet::Model and Genelet::Filter, you can generate Getter and Setter for class attributes and initialize their values.
__PACKAGE__->setup_accessors( %hash );
The keys and values in hash are the attributes and their default values. For example,
__PACKAGE__->setup_accessors( exmpl=>"some string" );
You can get it as $self->exmpl() resulting in “some string”. Or set it up as $self->exmp(“other”).
Setting up an attribute value via setup_accessors will override that in parents.