Moose can look kind of daunting, but it's pretty intuitive:

# Car.pm package Car; use Moose; has make => ( isa => 'Str', is => 'rw' ); has model => ( isa => 'Str', is => 'rw' ); has year => ( isa => 'Int', is => 'rw' ); no Moose; __PACKAGE__->meta->make_immutable();

# car.pl #!/usr/bin/perl use Car; my $car = Car->new({ make => 'Toyota', model => 'Matrix' }); $car->year(2004);