use strict; use warnings; { package Cat; use Moo; use Types::Standard -types; has name => ( is => 'ro', isa => Str, ); } { package Litter; use Moo; use Types::Standard -types; has cats => ( is => 'ro', isa => ArrayRef[InstanceOf['Cat']], ); } my $cat1 = Cat->new(name=>'Garfield'); my $cat2 = Cat->new(name=>'Felix'); my $litter = Litter->new(cats => [$cat1, $cat2, 1]);