use base qw(Some::Package); #### sub new { my $proto = shift; my $class = ref($proto) || $proto; my %args = @_; bless($self, $class); $self->init(); foreach my $arg (keys(%args)) { $self->$arg($args{$arg}); } } #### sub init { my $self=shift; $self->{_permitted} = \%fields; #... and add the other fields also };