in reply to can you repeat a character N times using HTML::Template?

HTML::Template in and of it's self does not allow for recursion. However, recently when I was attempting solve a problem similar to this, what I did was write a template that *allowed* for recursion and then used the perl code to actually recurse. In other words, my template looked something like this:
<div> <tmpl_var one> <tmpl_var two> <tmpl_var recursion_data> </div>
Then in my perl code I did something similar to:
my $ht=new HTML::Template(filename=>recurse.tmpl); my $data; while($foo=recurse()) { $ht->param(one=>foo,two=>bar, recursion_data=>$data); $data=$ht->output; $ht->clear_params(); }
Thus the total output is constantly updated with all the data you have generated so far, then you stick that data inside the template and do it again. Seemed rather elegant to me at the time, but this may not at all be what you are considering.

(Btw, if in fact you are doing something similar to what I think you, some sort of nested tree structure and your trying to indent each layer, appropiate, what I did was make each <div></div> in my recursion template have a padding of 5 pixels left or whatever. That way when I nest all of the divs, each one inherits the padding value of all of it's parents, so the first layer had 5 px, the second layer had 10 and so on and so forth. Thus combining the beauty of HTML::Template with the simplicity that is CSS. There are several benefits to doing it this way, such as it's incredibly easy to change the padding for each layer, just change one value in the style sheet, instead of mucking about with perl code.)