in reply to IF in a loop using HTML::Template
I dont understand why I am getting the error since I have the TMPL_IF NAME="test"> tag in the .tmpl file.
Maybe you're loading the wrong template, who knows, so turn on debugging, and figure it out
#!/usr/bin/perl -- use strict; use warnings; use HTML::Template; my $template = HTML::Template->new( die_on_bad_params => 1, #~ scalarref => \'<tmpl_if spectacles>glasses<tmpl_else>stars</tmp +l_if> ', scalarref => \'<tmpl_if name="spectacles">glasses<tmpl_else>stars< +/tmpl_if> ', debug => 1, #~ stack_debug => 1, ); $template->param( spectacles => 0 ); print $template->output; $template->param( spectacles => 1 ); print $template->output; print "\n"; __END__ ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /fake/path/for/non/file/template : line 1 + : TMPL_IF spectacles start ### HTML::Template Debug ### /fake/path/for/non/file/template : line 1 + : ELSE ### HTML::Template Debug ### /fake/path/for/non/file/template : line 1 + : /TMPL_IF end ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output stars glasses
See Basic debugging checklist, brian's Guide to Solving Any Perl Problem
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: IF in a loop using HTML::Template
by Anonymous Monk on Mar 20, 2013 at 19:20 UTC | |
by Anonymous Monk on Mar 20, 2013 at 19:24 UTC | |
by Anonymous Monk on Mar 20, 2013 at 19:49 UTC |