I have a Perl routine which does this:

my $count = 0;

while($sth->fetchrow_arrayref) {
    if ($count % 2) {
        print "something";
    }
    else {
        print "something else";
    }
    $count++;
}

Is this the equivalent?

[% count = 0;
    WHILE ($sth->fetchrow_arrayref) %]
        [% IF ($count % 2) %]
            print "something";
        [% ELSE %]
            print "something else";
        [% END %]
    count++;
[% END %]

Just trying to wrap my head around converting it to TT format.

Robert




_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to