in reply to Odd and even table rows

If you do not need the value of $i, you could use the XOR operator:
$i = 0 for( $j = 0; $j < 10 ; $j++ ) { if( $i == 0 ) { $class = "even" ; } else { $class = "even" ; } $i ^= 1 ; }
Or you could toggle $i between two values:
$i = 1 ; for( $j = 0; $j < 10 ; $j++ ) { $i *= -1 ; if( $i == -1 ) { $class = "even" ; } else { $class = "even" ; } }
Or you could just flip the value of $class:
if( $class =~ /even/ ) { $class = "odd" ; } else { $class = "even" ; }
Or
$class = ( $class ~= /even/ ) ? "odd" : "even" ;

Enjoy
Keith