http://qs321.pair.com?node_id=522829


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.