Thanks for your answer, Philip.

> You may be able to do it through a filter.

I'm afraid this will not help. Let me explain what I want to do, and
perhaps there are some other way to solve this that I have not yet
thought of.

I work on a WWW front-end to usenet news, and I would like to create a
threaded view of all articles in a newsgroup. A very simple way to
represent a threaded view is to use unordered lists:

<ul>
  <li>Article one</li>
  <ul>
     <li>Re: Article one</li>
     <ul>
        <li>Re: Article one</li>
        <li>Re: Article one</li>
     </ul>
     <li>Re: Article one</li>
  </ul>
</ul>

In Perl, I create a recursive list of hashes, so that
$list[$offset]{thread} points to another list of hashes. My idea was
that the following template would work:

<tmpl_if name="thread">
<ul>
<tmpl_loop name="thread">
<li><tmpl_var name="subject"></li>
<tmpl_include name="thread.html">
</tmpl_loop>
</ul>
</tmpl_if>

This template is placed in the main template file, and thread.html
contains exactly the same code. My expectation was that thread.html
would be recursively included as long as the thread parameter contains
anything to iterate over.

But it does not work, since HTML::Template recursively includes
thread.html an infinite number of times (or max_includes times) when the
template is created, not when the template is evaluated.

Are there any other solutions to create a recursive template like this
one?

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to