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 } ) );