Class-ExtraAttributes

 view release on metacpan or  search on metacpan

lib/Class/ExtraAttributes.pm  view on Meta::CPAN


 package MyObject;
 use base qw( AnyClass );

 use Class::ExtraAttributes qw( foo );

 my $object = MyObject->new;
 $object->foo($value);
 my $value = $object->foo;

 sub update {  # in case you want persistence for extra attributes
     my $object= shift;
     $object->SUPER::update(@_);

     my @extra= Class::ExtraAttributes->attributes;
     # perform update for extra attributes
 }

 sub retrieve {  # in case you have persistence of extra attributes
     my $class= shift;
     $class->SUPER::retrieve(@_);



( run in 0.237 second using v1.01-cache-2.11-cpan-4d4bc49f3ae )