#!/usr/bin/env perl { package FishTaco::Topping; use Moo; } { package FishTaco; use Moo; use MooX::HandlesVia; use Types::Standard qw( ArrayRef InstanceOf ); has _toppings => is => "rw", isa => ArrayRef[ InstanceOf['FishTaco::Topping'] ], default => sub { [] }, handles_via => "Array", handles => { add_topping => "push", toppings => "elements", }; } use strictures; use Path::Tiny; use Scalar::Util "blessed"; my $ft = FishTaco->new; $ft->add_topping( FishTaco::Topping->new ); # Sure. $ft->add_topping( path("/") ); # Wrong object type. $ft->add_topping( "OHAI" ); # Not even an object. print blessed($_) || "[n/a]", $/ for $ft->toppings; __END__ FishTaco::Topping Path::Tiny [n/a]