I've always wondered how you separate things like alternating table row background colors. Currently, I assign it in code, but that sucks. HTML::Template doesn't appear to have enough logic features to allow you to do modulus division on each iteration and pick a bgcolor from an array. So I have color definitions in my code - which sucks if the designer wants to change the colors. Of course, then I could use something like a config file or store the colors in a db, but that way, it's separated into 3 different areas instead of just two.
my @colors = ('#FFFFFF', '#F0F0F0');
my $cnt = 1;
foreach my $row (@$list) {
$row->{bgcolor} = $colors[$cnt % 2];
# Assign $row to your template engine or AoH or whatever...
$cnt++;
}