in reply to Odd and even table rows

Yet another way.
my @classes = qw( odd even ); while (...) { push @classes, my $class = shift @classes; ... }

Here's a collection of alternatives, including those already presented:

All code snippets tested except the one using Tie::Cycle.

Update: Added wind's solutions.