# generate a new template handler my $th=Template::YetAnother->new ({ namespace=>'acme', template_dir=>'/projects/acme/templates/', }); # build up a data structure $data={ title=>$th->title('this is the title'), breadcrumb=>[ $th->link({url=>'/index.html',text=>'Home'}), $th->separator_breadcrumb, $th->link({url=>'/acme/index.html',text=>'Acme'}), $th->separator_breadcrumb, $th->link({url=>'/acme/bleach.html',text=>'Bleach'}), ], content=>[ $th->element({heading=>'SYNOPSIS',value=>'blabla'}), $th->element({heading=>'DESCRIPTION',value=>'foo bar'}), ], lastmod=>scalar localtime, }; # fill template & print print $th->fill({data=>$data}); ################################################## # for this to work, we need the following files in # /projects/acme/templates # file: main.tpl
[% value %]
; ################################################## # the finished template should look like this:blabla
;foo bar