my @neuarray=(); for(0..@array/2-1) { push @neuarray, [@array[$_*2,$_*2+1]]; } @array=@neuarray;