use strict; use warnings; use MooseX::Struct; immutable struct Cat => ( name => { isa => 'Str' }, ); immutable struct Litter => ( cats => { isa => 'ArrayRef[Cat]' }, ); my $cat1 = Cat->new(name=>'Garfield'); my $cat2 = Cat->new(name=>'Felix'); my $litter = Litter->new(cats => [$cat1, $cat2, 1]);