in reply to Self creating OO Module field accessors...
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 Section
Seekers of Perl Wisdom