use strict;
use Data::Dumper;
use HTML::Template;
warn $INC{'HTML/Template.pm'};
my ($output, $template, $result);
$template = HTML::Template->new_scalar_ref(
\q{
#Q: ?
#a)
#b)
#c)
#d)
},
debug => 1,
# memory_debug => 1,
);
$template->param(
NO_NAME_LOOP => [
map {
my %H;
my $c=$_;
$H{$_}= $c->[$_] for 0..$#$_;
\%H;
}
[ Hello => hello => goodbye => biscuits => 'What??!' ],
[ Tacos => yes => please => no => 3 ],
[ 'Smell That', yes => hmmm => 'Tacos?' => 'noxious' ],
[ qw{ rubber baby buggy bumpers rock } ],
],
);
$output = $template->output;
print $output;
print Dumper($template);
=pod
Initially, I wanted to be was gonna patch this thing
to accept input in param exactly as above, minus that little map
statement.
It turns out it's WAAAAAAAAAAAAAAAAAAAAAY too much work, for
BEYOND NO BENEFIT. I'll just stick with that little map statement folks.
On the other hand, I did get tired of saying
...
So now the patch I suppose to write is one that would, after encountering
automagically generate the param'var's 1 and 2, as opposed to creating ''
which is real stupid if you ask me
So it looks like i gotta patch sub _parse
BTW ~ if I "eval" that Dumper output, and call $VAR1->output
HTML::Template throws
HTML::Template->output() : fatal error in loop output
: HTML::Template::param() : attempt to set parameter '0' with a scalar
- parameter is not a TMPL_VAR!
at C:/Perl/site/lib/HTML/Template.pm line 2789
Wassup????
=cut