use Minions (); my %Method; # maybe this hash could be already imported into # the namespace with a param passed to Minions my %Class = ( name => 'Counter', interface => [qw( next )], implementation => { methods => { next => $Method{'next'}, }, has => { count => { default => 0 }, }, }, ); $Method{'next'} = sub { my ($self) = @_; # maybe this could be avoided with some sugar $self->{-count}++; }; Minions->minionize(\%Class);