my $t; while ($pointer = $sth->fetchrow_hashref){ my $class = qw(even odd)[$t^=1]; ... }