Apparently between 2.07 and 2.08, the DEBUG flag added some new
meaning. For example, a template of mine processed through this
template object:
my $tt = Template->new({
START_TAG => quotemeta('{{'),
END_TAG => quotemeta('}}'),
DEBUG => 1, # throw exception on unknown variable
VARIABLES =>
{
url => $url_func,
URL => $url_func,
user => $user_func,
USER => $user_func,
# ttcode is used for headers and other places
# we just want literal code in the final template
# processing. For internal use only!
ttcode => $code_func,
},
}
)
or return $self->error('Prep template allocation failure.');
outputs something like this:
From: "The Big V" <[EMAIL PROTECTED]>
Subject: ffff
To:
## input text line 3 : ##
[EMAIL PROTECTED]
Errors-To:
## input text line 4 : ##
[EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: text/plain
but if I comment out the DEBUG line, it produces correct looking
output:
From: "The Big V" <[EMAIL PROTECTED]>
Subject: ffff
To: [EMAIL PROTECTED]
Errors-To: [EMAIL PROTECTED]
MIME-Version: 1.0
Content-Type: text/plain
This is the input template:
From: "The Big V" <[EMAIL PROTECTED]>
Subject: ffff
To: {{user("email")}}
Errors-To: {{ttcode("smtpsender")}}
MIME-Version: 1.0
Content-Type: text/plain
The Template manual still says this about DEBUG:
DEBUG
Flag which, when enabled, causes any access to an
undefined variable to be raised as an 'undef' error.
It says nothing about line number reporting within the template output
every time a command is executed.
I don't have a patch handy, but I'm sure it is not difficult...
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates