in reply to Switching back and forth between parts of my script

Maybe you could just alternate between the two arrays:
while (1) { if (@array1) { #.... } if (@array2) { #.... } }