my $document = MyApp::Note->new( to_collection => [MyApp::To->new(text => 'Bob')], from_collection => [MyApp::From->new(text => 'Alice')], headings => [MyApp::Heading->new(text => 'Secret' )], body_collection => [MyApp::Body->new(text=>'Shh!')], ) #### coerce 'MyApp::To' => from 'Str' => via { MyApp::To->new(text => $_) }; coerce 'MyApp::From' => from 'Str' => via { MyApp::From->new(text => $_) }; coerce 'MyApp::Heading' => from 'Str' => via { MyApp::Heading->new(text => $_) }; coerce 'MyApp::Body' => from 'Str' => via { MyApp::Body->new(text => $_) };