package Child; use Moose; extends 'Parent'; has 'knuisje' => ( is => 'rw', isa => 'Str', lazy_build => 1, ); sub BUILD { my $self = shift; my $meta = $self->meta; print("BUILD called for " . __PACKAGE__ . "\n"); no strict; foreach my $attribute ($meta->get_attribute_list) { print("Creating builder for attribute [$attribute]\n"); *{__PACKAGE__ . '::_build_' . $attribute} = sub { my $self = shift; my $meta = $self->meta; my $fropsel = $meta->get_attribute($attribute); if ($fropsel->type_constraint->name =~ /^Str/) { return ""; } }; } use strict; } 1;