Build your own type constraints
package Time; use Moose; use Moose::Util::TypeConstraints; use DateTime; subtype 'DateTime' => as Object => where { $_->isa('DateTime') }; has 'time' => ( is => 'ro', isa => 'DateTime', default => sub { DateTime->now(); } );
Then use it:
package main; my $d = Time->new(); print $d->time()->mdy;