The Class::Accessor module automagically generates accessor/mutators for your class. . Most of the time, writing accessors is an exercise in cutting and pasting. If you make your module a subclass of Class::Accessor and declare your accessor fields with mk_accessors() then you will find yourself with a set of automatically generated accessors which can even be customized.