# 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"; }