Is there anyway that I can get HTML::Template to evaluate recursively without iteratively recusting templates myself. This is what I'd like be able to do:
#!/usr/bin/perl -w
use strict;
use HTML::Template;
my $s= '<tmpl_var name="foo">';
my $h=HTML::Template->new(scalarref => \$s);
$h->param( foo => '<tmpl_var name="bar">');
$h->param( bar => 'baz');
print $h->output();
but this is the only way I can get it to work:
#!/usr/bin/perl -w
use strict;
use HTML::Template;
my $s= '<tmpl_var name="foo">';
my $h=HTML::Template->new(scalarref => \$s);
$h->param( foo => '<tmpl_var name="bar">');
$s=$h->output();
$h=HTML::Template->new(scalarref => \$s);
$h->param( bar => 'baz');
print $h->output();
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is similar to meta-template functionality requested by frapan in this forum. First, please describe WHAT do you want to first. Only after that we can find the best way to do your task. Maybe someone will be able to offer a better solution to your problem. Second, why you don't like the second method you offered? Do you think it's too complicated?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Is there anyway that I can get HTML::Template to evaluate recursively without iteratively recusting templates myself. This is what I'd like be able to do:
#!/usr/bin/perl -w
use strict;
use HTML::Template;
my $s= '<tmpl_var name="foo">';
my $h=HTML::Template->new(scalarref => \$s);
$h->param( foo => '<tmpl_var name="bar">');
$h->param( bar => 'baz');
print $h->output();
but this is the only way I can get it to work:
#!/usr/bin/perl -w
use strict;
use HTML::Template;
my $s= '<tmpl_var name="foo">';
my $h=HTML::Template->new(scalarref => \$s);
$h->param( foo => '<tmpl_var name="bar">');
$s=$h->output();
$h=HTML::Template->new(scalarref => \$s);
$h->param( bar => 'baz');
print $h->output();
This is similar to meta-template functionality requested by frapan in this forum. First, please describe WHAT do you want to first. Only after that we can find the best way to do your task. Maybe someone will be able to offer a better solution to your problem. Second, why you don't like the second method you offered? Do you think it's too complicated?