分类:
2008-06-25 15:41:22
The process()
method is called to process a template
specified as the first parameter, $input
. This may be a file
name, file handle (e.g. GLOB
or IO::Handle
) or
a reference to a text string containing the template text. An additional
hash reference may be passed containing template variable definitions.
The method processes the template, adding any or templates
defined, and returns the output text. An uncaught exception thrown by the
template will be handled by a relevant
handler if defined. Errors that occur in the or templates, or
those that occur in the main input template and aren't handled, cause the
method to return undef
to indicate failure. The appropriate
error message can be retrieved(取回, 挽回, 弥补, 恢复, 补偿, 回忆, 检索) via the method.
$service->process('myfile.html', { title => 'My Test File' })
|| die $service->error();