Skip Menu |
 

This queue is for tickets about the HTML-CTPP2 CPAN distribution.

Report information
The Basics
Id: 52068
Status: open
Priority: 0/
Queue: HTML-CTPP2

People
Owner: Nobody in particular
Requestors: dmitry.kasimovsky [...] mmska.ru
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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>
Download (untitled) / with headers
text/plain 976b
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>
Download (untitled) / with headers
text/plain 1.2k
NOT A BUG Read Documentation first!!! http://ctpp.havoc.ru/doc/ru/ctpp_operators.html Срд. Ноя. 25 12:28:43 2009, dmitry.kasimovsky@mmska.ru писал: Show quoted text
> 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> > >


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.