use strict; use Data::Dumper; $Data::Dumper::Indent=1; $Data::Dumper::Indent=1; use blib; use HTML::Template; warn $INC{'HTML/Template.pm'}; my ($output, $template, $result); ## apparently, a creates 5 of a '' kind ## maybe i should like a ## but anyway, mission 1, make _parse parse it right ## (IGNORE THE DEBUG VARS IN THE TEMPLATE for now) $template = HTML::Template->new_scalar_ref( \q{ #Q: ? #a) #b) #c) #d) }, debug => 1, # memory_debug => 1, ); #print Dumper($template); $output = ### THIS IS THE OUTPUT I EXPECT '#Q: Hello ? #a) hello #b) goodbye #c) biscuits #d) What??! #Q: Tacos ? #a) yes #b) please #c) no #d) 1 #Q: Smell That ? #a) yes #b) hmmm #c) Tacos? #d) noxious #Q: rubber ? #a) baby #b) buggy #c) bumpers #d) rock '; ## param will die, as it don't know what to do ... YET! $template->param( NO_NAME_LOOP => [ [ Hello => hello => goodbye => biscuits => 'What??!' ], [ Tacos => yes => please => no => 1 ], [ 'Smell That', yes => hmmm => 'Tacos?' => 'noxious' ], [ qw{ rubber baby buggy bumpers rock } ], ], ); $output = $template->output; print $output; $template = HTML::Template->new_scalar_ref( \q{ a: b: A: B: }, debug => 1, # memory_debug => 1, ); #print Dumper $template; $template->param( NO_NAME_LOOP => [ [ 'ABE', 'LINCOLN' ], { 0 => 'BOO', 1 => 'BAH', NO_NAME_LOOP_A_NEW => [ [ 'AGAIN', 'ONCE MORE' ], [ 'NO', ' MORE' ], ] }, { 0 => 'GEORGE', 1 => 'CLOONEY', NO_NAME_LOOP_A_NEW => [ { 0 => 'SUCKS', 1 => 'ROCKS', }, { 0 => 'REAL', 1 => 'BAD', } ] } ], ); $output = $template->output; print $output; ## THIS IS ILLEGAL, a nameless TMPL_VAR outside of a LOOP $template = HTML::Template->new_scalar_ref( \q{ }, debug => 1, # memory_debug => 1, ); __END__ ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /*IN_MEMORY*/ : line 2 : LOOP no_name_loop start ### HTML::Template Debug ### /*IN_MEMORY*/ : line 3 : parsed VAR 0 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 4 : parsed VAR 1 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 5 : parsed VAR 2 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 6 : parsed VAR 3 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 7 : parsed VAR 4 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 9 : LOOP end ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output #Q: Hello ? #a) hello #b) goodbye #c) biscuits #d) What??! #Q: Tacos ? #a) yes #b) please #c) no #d) 1 #Q: Smell That ? #a) yes #b) hmmm #c) Tacos? #d) noxious #Q: rubber ? #a) baby #b) buggy #c) bumpers #d) rock ### HTML::Template Debug ### In _parse: ### HTML::Template Debug ### /*IN_MEMORY*/ : line 2 : LOOP no_name_loop start ### HTML::Template Debug ### /*IN_MEMORY*/ : line 3 : parsed VAR 0 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 4 : parsed VAR 1 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 5 : LOOP no_name_loop_a_new start ### HTML::Template Debug ### /*IN_MEMORY*/ : line 6 : parsed VAR 0 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 7 : parsed VAR 1 ### HTML::Template Debug ### /*IN_MEMORY*/ : line 8 : LOOP end ### HTML::Template Debug ### /*IN_MEMORY*/ : line 9 : LOOP end ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output ### HTML::Template Debug ### In output a: ABE b: LINCOLN a: BOO b: BAH A: AGAIN B: ONCE MORE A: NO B: MORE a: GEORGE b: CLOONEY A: SUCKS B: ROCKS A: REAL B: BAD ### HTML::Template Debug ### In _parse: HTML::Template->new() : No NAME given to a TMPL_VAR tag at /*IN_MEMORY*/ : line 1. at E:/dev/HTML-Template/HTML-Template -2.5/blib/lib/HTML/Template.pm line 1862.