package Person; use Moo; use Types::Standard 'Int'; has name => (is => 'rw'); has age => (is => 'rw', isa => Int ); 1; #### perl -I. 1223262.pl Foo 22 Value "young" did not pass type constraint "Int" (in $self->{"age"}) at 1223262.pl line 9 "Int" is a subtype of "Num" "Num" is a subtype of "LaxNum" Value "young" did not pass type constraint "LaxNum" (in $self->{"age"}) "LaxNum" is defined as: (defined($_) && !ref($_) && Scalar::Util::looks_like_number($_))