Actually I think evals and strings would be a good match for this use case because the primary use here is only done once, on module load (this could be done at near-compile time by putting the method generators in a BEGIN block).
However this specific case would be more generally solvable as a compile time macro, i.e. expanding the macro call at compile time into exactly what you want. The only reason I haven't seriously considered going with eval and strings is I haven't had the time to put together a good proof of concept for comparison's sake. When I do, I may ask about clarity here or in the seekers forum.
In reply to Re^3: The Case for Macros in Perl
by einhverfr
in thread The Case for Macros in Perl
by einhverfr
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |