in reply to Line Numbers in Filtered Code
I don't just want the replacement code readable in ::Any's source; I want it readable on those occasions when I dump the filtered code to screen or file.
I think you're allowing your compulsion get the better of your judgement.
The biggest single problem with code generation, is the error reporting. The second, is people being tempted into hand editing the generated source. By making it readable, you're simply tempting people to read it. And once they do, it's a small step to just tweaking it here and there...with all the subsequent problems that creates.
Generated source code should never be seen. You as the author of the module will need to look at it during development, but rather than expending energy on try to format it nicely, why not just Perl::Tidy it when you need to?
You save yourself a bunch of work on the formatting; avoid creating (and having to solve) another bunch of problems with line numbering; and avoid leading users into the temptation of actually reading the generated code.
Seems like a 3-way win for the inconvenience of having to tidy.
|
|---|