Subject: | Invalid contextual variable (error code 0x04000011) in LOOP |
Date: | Wed, 25 Nov 2009 15:37:54 +0300 |
To: | bug-HTML-CTPP2 [...] rt.cpan.org |
From: | Dmitry Kasimovsky <dmitry.kasimovsky [...] mmska.ru> |
Hi!
I had some strange error in TMPL_LOOP. When loop internal variable
starts with "_", then HTML-CTPP2 return error: "Invalid contextual
variable (error code 0x04000011)".
SYSTEM:
Gentoo Linux 2.6.24-gentoo-r8
Perl 5.8.8
ctpp2 2.5.11
HTML-CTPP2 2.5.10
PERL CODE:
#!/usr/bin/perl
use strict;
use warnings;
use utf8;
use HTML::CTPP2;
my $TMPL = new HTML::CTPP2 (
arg_stack_size => 1024,
code_stack_size => 1024,
steps_limit => 1024*1024,
max_functions => 1024,
source_charset => 'utf-8',
destination_charset => 'utf-8'
);
$TMPL->include_dirs([$TMPL_DIR]);
my $param = {};
$param->{languages} = [{
_title => 'Русский',
_value => 1,
}];
my $bytecode = $TMPL->parse_template( "entry.tmpl");
$TMPL->param($param);
$output = $TMPL->output($bytecode);
print $output;
HTML TEMPLATE (entry.tmpl):
<TMPL_LOOP languages>
<option value="<TMPL_VAR _value>"><TMPL_VAR _title></option>
</TMPL_LOOP>