|Just another Perl shrine
Re^9: OO automatic accessor generationby eric256 (Parson)
|on Nov 12, 2009 at 20:31 UTC
I wasn't even attempting to duplicate the behavior and I always work with refs for arrays and hashses, so that felt like the natural use here. The point I was making wasn't about your memory. Say you make 5 scripts and hand roll the OO implementation each time. Now instead of one central documented module you have 5 that might have small difference depending on the needs of each. There is no centralized code or process for these OO modules you have created (yes you could create one, and tests and documentation, and that might be the right solution for some cases). So now for each script i have to go read your implementation of the getter/setter and watch for small changes that will bite me. If instead I use Moose then I can read documentation in one location and understand all of the scripts.
Either way my point wasn't USE MOOSE, or anything along those lines. Think of it more as, hey, there might be a solution already built and this one looks pretty spiffy, check it out and see if it fits your needs or not. I've used Moose, and hand rolled OO for different cases and different needs, so it might not be the right tool in this case, but it might be, and for that reason there is no reason not to mention it here in response to the OP.