recursion??

Les Howard
2001-03-12
2001-12-06
  • Les Howard

    Les Howard - 2001-03-12

    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();

     
    • Andrey Melnikov

      Andrey Melnikov - 2001-12-06

      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?

       

Log in to post a comment.