On Fri, Aug 03, 2001 at 12:28:21PM +0300, Oleg Burlaca wrote:
> I'd like to see if the template is ok(almost ok) before some script uses it.
If you fetch a reference to the context object:
my $context = $template->context();
you can then pre-fetch a template to see if it compiled or not:
my $compiled;
eval {
$compiled = $template->template('filename');
};
if ($@) {
# Bad Template!
}
else {
# Good Template!
$template->process($compiled);
}
and pass the compiled template reference to process() if all
went well.
HTH
A