in reply to writing array as pairwise

Either copy to a new array and shift twice to get all "pairs"

or iterate an index with step 2 and print a array slice

@member[$i,$i+1]

But your use of nested loops doesn't make sense, could be that your problem description is misleading.

Tip: providing input and desired output data helps if you can't express yourself.

Cheers Rolf

PS: Je suis Charlie!