# In the configuration section... my @Toggles = ('on', 'off'); # In some loop in the code... $Toggles[$flip = !$flip] #### my @BGColors = ('#dddddd', '#ffffff'); for (1..10){ # As you loop through a database query result or something print qq{ $_ }; } #### # To cycle through any number of elements... my @Cheers = ('hip', 'hip', 'hoo', 'ray'); my $flip = -1; for (1..12){ print "$Cheers[$flip = ++$flip % 4]\n"; }