permutation in perl script : Hi i am working on a script in perl i have seen codes for permutation but my problem is i have an array with values say @array =(john, cena , barrack, obama, donald, trump) value at index 0 is first name and at 1 is last name at 2 is first name again and at 3 is last name and so on. so it should be like
john cena
barrack obama
donald trump

i need permutation for this combination
barrack obama
donald trump
john cena

donald trump
john cena
barrack obama

like this 
how this can be done!!