in reply to Group array in threes

Why not use splice ...
while (@array) { print join(',', splice @array, 0, 3) . qq/\n/ }
... or some such?

A user level that continues to overstate my experience :-))