Are these three independent snippets, or does your main script actually look like that?
in reply to Re: Two tips for developing with HTML::Template
in thread Two tips for developing with HTML::Template
They're independent snippets, culled from a much larger script (and template), with non-essential parts stripped away for purposes of illustrating the two techniques.
Perhaps you should have combined these techniques, pushing $@ onto @debuglog instead of printing it out.
The problem with this is twofold: first, once an exception gets caught, there's no guarantee that a template will produce output. Second, the two snippets are useful at non-overlapping phases of development. Using eval helps diagnose and repair template problems; the debug log trick helps diagnose application-level errors once templates are working. Until the former problems are handled, I don't worry about the latter ones.