"be consistent" | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
I was actually thinking about this problem this morning (though with regard to HTML::Template, though it should be possible to generalize it to any template system). The problem with keeping two sets of templates (production and debugging) is that a change in the variables sent means you have to update both templates. Ick. Instead, the template module should take a 'debug' option. When activated, the template system will still open the template files and parse them (thus allowing things like HTML::Template's strict mode to work). However, instead of outputing the filled-in template, the system outputs a plaintext version containing the data structure that would otherwise be used to fill-in the template, and is thus easy to parse. Simply dumping with Data::Dumper would be OK (though that would make it harder to parse with anything except Perl). YAML would be a better choice. ---- : () { :|:& };: Note: All code is untested, unless otherwise stated In reply to Re: Testing Template, or should I write a diff for TT templates?
by hardburn
|
|