say join(',', splice(@array, 0, 3)) while @array;