use 5.010; use MooseX::Declare; class Manager { }; class Server { has 'hdr' => ( is => 'rw' ) }; class Archive { #.. other methods method init_archive ( Manager :$mgr!, Int :$debug, Str :$user!, Str :$pass!, Str :$path! where { $_ !~ /:/ and $_ =~ m{^[\\/]} }, HashRef :$target_args! where { ($_->{NR} and $_->{SID} and $_->{dt}) or ($_->{NR} and $_->{SID} and $_->{hostname}) }, Server :$master where { defined $_->hdr } ) { say "ARCHIVE INITIALISED"; return $self; } } Archive->new->init_archive( user => 'boldra', pass => 'secret', path => 'd:\\data\\DYV\\', # path => '//hostname/d$/data/DYV', mgr => Manager->new, target_args => { NR => '01', SID => 1, hostname => 'localhost' }, master => Server->new( { hdr => 1 } ) ); #### Validation failed for 'MooseX::Types::Structured::Tuple[MooseX::Types::Structured::Tuple[Object],MooseX::Types::Structured::Dict[mgr,Manager,debug,MooseX::Types::Structured::Optional[Int],user,Str,pass,Str,path,__ANON__,target_args,__ANON__,master,MooseX::Types::Structured::Optional[__ANON__]]]' failed with value [ [ Archive=HASH(0x2a012a8) ], { master => Server=HASH(0x2a7ce38), mgr => Manager=HASH(0x2a708e0), pass => "secret", path => "d:\data\DYV\", target_args => HASH(0x1aa3ad8), user => "boldra" } ], Internal Validation Error is: Validation failed for 'MooseX::Types::Structured::Dict[mgr,Manager,debug,MooseX::Types::Structured::Optional[Int],user,Str,pass,Str,path,__ANON__,target_args,__ANON__,master,MooseX::Types::Structured::Optional[__ANON__]]' failed with value { master => Server={ hdr => 1 }, mgr => Manager={ }, pass => "secret", path => "d:\data\DYV\", target_args => { NR => 01, SID => 1, hostname => "localhost" }, user => "boldra" } at /usr/lib/perl5/site_perl/5.10/MooseX/Method/Signatures/Meta/Method.pm line 445 MooseX::Method::Signatures::Meta::Method::validate('MooseX::Method::Signatures::Meta::Method=HASH(0x2a7cec8)', 'ARRAY(0x29e1788)') called at /usr/lib/perl5/site_perl/5.10/MooseX/Method/Signatures/Meta/Method.pm line 145 Archive::init_archive('Archive=HASH(0x2a012a8)', 'user', 'boldra', 'pass', 'secret', 'path', 'd:\data\DYV\', 'mgr', 'Manager=HASH(0x2a708e0)', ...) called at /home/boldra/archive_test.pl line 40