in reply to Re: Odd and even table rows
in thread Odd and even table rows

or a little less verbose and (imho :) ) even more readable:

my $odd; my $class; while( $pointer = $sth->fetchrow_hashref ) { $class = ($odd ^= 1) ? "odd" : "even"; ## ... }

DWIM is Perl's answer to Gödel