@datan = ("1","2","3","4","5","6"); while ( my @x = splice(@datan, 0, 3) ) { print join(" ",@x), "\n"; }