if you are using H::T::E you can leave your output formatting to the template, and
leave your Perl code as a single loop (with no embedded loops). eg:
my @loop;
for ... {
push @loop, something;
}
$t->param(loop => [EMAIL PROTECTED]);
<!-- want 3 columns -->
<table ...>
<TMPL_LOOP loop>
<TMPL_IF EXPR="(__counter % 3) == 1">
<tr>
</TMPL_IF>
<td>
<TMPL_VAR blah>
</td>
<TMPL_IF EXPR="(__counter % 3) == 0">
</tr>
</TMPL_IF>
</TMPL_LOOP>
</table>
In this example, the formatting out the HTML is completly in the hands of the template
-> the Perl code need not know anything about how the array will get displayed.
Mathew
PS. I use it to make a 3-column display of an image gallery -
http://www.lrautomotive.com.au/gallery.html
> I've got an image gallery that I want displayed as three columns.
>
> Am I right in assuming that I need to code it up as an array of rows
> containing the array of the column cells?
>
> Anyone got any nice idiomatic perl for transforming a simple array
> into one of these? ;-)
>
> Ta,
>
> Dave
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by Sleepycat Software
> Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
> deliver higher performing products faster, at low TCO.
> http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
> _______________________________________________
> Html-template-users mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/html-template-users
>
-------------------------------------------------------
This SF.Net email is sponsored by Sleepycat Software
Learn developer strategies Cisco, Motorola, Ericsson & Lucent use to
deliver higher performing products faster, at low TCO.
http://www.sleepycat.com/telcomwpreg.php?From=osdnemail3
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users