@colors = (black, white); $flipflop=0; while ($n < $nmax) { print("content"); $flipflop = 1 - $flipflop; }