in reply to a simple matter of elegance
I'm not sure I'm too keen on the AUTOLOAD-based suggestions. I would have almost suggested Object::Tiny, which is probably one of the nicest ways of doing what you want... except that it will fall apart on the fact that the elements in question are all hanging off a subkey. And I suspect most other packages of this nature will, as well.
You could of course steal the code from Object::Tiny::import to inject the accessors and have them fetch the information from the correct part of your object. Or restructure the innards of your object to lift them up to the top level. Or delegate them to a sub-object... the possibilities are endless.
• another intruder with the mooring in the heart of the Perl
|
|---|