So do I understand correctly you want one file per while loop execution? If so, here: $alldata .= $data_tmpl->output; you're appending the return value of $data_tmpl->output to $alldata (because you're using the .= operator instead of a plain = assignment), so you're accumulating all of the outputs in that variable, so each file you write will have more and more of the output collected. What happens if you remove that line and just write write_file("/location/$key.html", $data_tmpl->output); ? (note: untested)
If you want just one large file, it should be enough to move the write_file after the while loop. Unless you want that file to have a header and a footer?
In reply to Re: HTML::Template output to files.
by Anonymous Monk
in thread HTML::Template output to files.
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |