while(my($one,$two)=(shift(@aray),shift(@aray)) ) { ... #or even while(my($one,$two) = splice(@aray,0,2) ) { ...