I have to make a report for a big funding agency. I'm using
Template Toolkit to write a LaTeX document with all the 300 or so
required items filled in from a Perl hash.
Currently, some elements are missing from the hash. I'd like
to make a second template that would identify which values are
missing, and would output a perl script with just the
corresponding keys, like this
$hash{Project}->{GreatestDiscovery} = ;
so that I can fill in the missing values by hand. I'm trying to do
this using "hash.exists". But I cant make it work
For example, the item $hash{'Project'}->{'Start'} does exist. So a
simple template like this
Project.Start ... [%- Project.Start %]
writes this
Project.Start ... 01/01/2007
But my template using hash.exists() says that the same item does
_not_ exist. That template is (all on one line, in the original)
[% hash.exists('Project.Start')
? ''
: '$hash{Project}->{Start} = ;' %]
and it writes this
$hash{Project}->{Start} = ;
i.e. it takes the not-exist option (for everything that I throw at
it)
What am I doing wrong?
fwiw, I have
# $Id: Template.pm,v 2.84 2006/02/01 11:55:27 abw Exp $
# $Id: Base.pm,v 2.71 2006/01/30 20:04:49 abw Exp $
Thank you in advance for your help
RCH
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates