use strict; use warnings; { package Cat; use Moose; has name => ( is => 'ro', isa => 'Str', ); __PACKAGE__->meta->make_immutable; } { package Litter; use Moose; has cats => ( is => 'ro', isa => 'ArrayRef[Cat]', ); __PACKAGE__->meta->make_immutable; } my $cat1 = Cat->new(name=>'Garfield'); my $cat2 = Cat->new(name=>'Felix'); my $litter = Litter->new(cats => [$cat1, $cat2, 1]);