http://qs1969.pair.com?node_id=532075


in reply to Class::Accessor and Damian's PBP

If you have so many accessible properties that you need to generate accessors for them, you may need to re-think your design. Accessors are a code smell.

But assuming you have good reason to have so many accessors, I'm sorry to say I don't have a satisfactory answer to your question. I would go with Class::Accessor::Lvalue because I think that something that behaves like a variable (being settable and gettable) should have an interface like a variable. It is also very clear about when you're setting and when you're getting. If you then use Class::Accessor for the read-only accessors, everything is taken care of.


Caution: Contents may have been coded under pressure.