in reply to Re^3: Can I please have *simple* modules?
in thread Can I please have *simple* modules?
No, I don't have to retype them. I have a reasonable editor and it can chunk out plenty of boilerplate code for me. Regardless, code duplication is code duplication. If you want to put a bunch of cut-n-paste boilerplate in your modules, that's fine. I just don't like to do it in my modules and I don't want to have to maintain it in other's modules. That means more code I or a maintenance programmer has to wade through to understand what's going on.
Additionally, your method assumes a particular implementation (in this case, a blessed hashref). Not only does it make it easy for another programmer to violate encapsulation (even if it's only by accident), it also means that it's more work to switch your object to a blessed array ref or inside out objects.
There's been plenty written about why duplicating even simple things like accessors/mutators is bad. Rather than want to do that, I just do this:
use Class::BuildMethods qw/foo bar baz/;
With that, I get three accessors/mutators without code duplication or reliance on the internals. Further, it's easy to extend them with default values or validation code. In short, by my writing this module once, my other code is cleaner and more flexible.