in reply to Modules for autogenerating accessor/mutator methods

Attribute::Property is very elegant and simple. I like it mainly because it adds so little typing, instead using Perl's attributes to make any sub a property (accessor).
package Automobile; sub new : New; sub colour : Property; sub owner : Property { /^(?:Jack|Jill|Bob)$/ } package main; my $car = Automobile->new(colour => "red"); print $car->colour; # red $car->colour = "blue"; print $car->colour; # blue my $other_car = Automobile->new(owner => "Jack"); # works my $another_car = Automobile->new(owner => "Dad"); # fails