in reply to Creating instance methods using closures

Yes, this technique of closure generation and symbol table insertion is a standard way of generating accessors and other "repetitive" subroutine definitions.

There are a number of existing modules on CPAN that address this issue, but I don't know of any that generate the particular kind of two-level-lookup that you've described, so I think you're best off continuing to use this code to generate the methods yourself.

  • Comment on Re: Creating instance methods using closures