in reply to arrays: shifting in while loop

I see you got your answer as to what was happening in your code snippet from BrowserUk.

I don't know what context you want to use this in but the pairwise() function in List::MoreUtils may be helpful.

-- Ken