Meet fill()
use Template3; print Template3->fill( file => 'hello.tt3', data => { name => 'Badger' }, );
Thus Spake Andy:
The process()
method works like it does in TT2. It adds headers, footers,
wrappers, etc., and error handling mechanisms (note that the process()
method was broken at the time of writing but should be fixed Real Soon Now).
The fill()
method provides a lower-level method to fetch and fill a single
template. The first two arguments are the template type (text
, file
,
or something indicating a custom provider, e.g. database
, http
, etc)
and template name (strictly this is a scheme/uri pair). The remaining
arguments are processing options. Here we specify the data we want inserted
into the template (note: these arguments are subject to change). The method
returns the output generated or throws an error.