{ package Car; use Moo; use Types::Standard qw( Enum Int ); has drive_type => ( is => 'rw', isa => Enum['fwd', 'rwd', '4wd'], ); has body_type => ( is => 'rw', isa => Enum['sedan', 'wagon', 'coupe', 'hatch'], ); has engine_cap => ( is => 'rw', isa => Int, ); sub dump { require Data::Dumper; Data::Dumper->Dump(\@_); } } my $car = Car->new( drive_type => 'fwd', body_type => 'hatch', engine_cap => 1798, ); print $car->dump;