P is for Practical | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Still, if you think there is something inherently evil about eval that ought to eliminate it from all consideration, I would be interested in hearing your reasoning. Your eval version actually re-compiles the subroutines several times, if you use the symbol table version, this is only done once. While right now it might not seem a big issue, if these subroutines get more complex (input validation or something like that) it might become more of a cost. I could also see a usefulness for being able to define a vocabulary inside a package other than the current one. This is, of course, possible with eval version, but using the symbol table version it would be easier to check for accidental overriding of methods. I guess my point is that while eval works just fine now, it will likely not scale very well, and since the symbol table approach is not that much more complex, it probably makes sense to use that and leave room to scale.
-stvn
In reply to Re^3: Embedding a mini-language for XML construction into Perl
by stvn
|
|