Inheriting from Class::Accessor gives you the mk_accessors method:
package Big::Thing; use strict; use base qw(Class::Accessor Small::Thing Needful::Things); __PACKAGE__->mk_accessors(qw(field1 field2 field3)); sub new { ... return $package->SUPER::new({ %args }); };
Class::Accessor has the shortcoming that its constructor wants to be passed a hash reference. So you need to either override the default constructor or live with that.
In reply to Re: Self creating OO Module field accessors...
by Corion
in thread Self creating OO Module field accessors...
by blue_cowdawg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |