in reply to print join n times on a line
splice is the thing to use for chopping up arrays into bits. Note that the following code leaves @GetServiceList empty by the tiime it's finished so make a copy first if you need it for further processing.
#!/usr/bin/perl use strict; use warnings; my @GetServiceList = 'a' .. 'z'; print join (', ', splice @GetServiceList, 0, 7), "\n" while @GetServic +eList;
Prints:
a, b, c, d, e, f, g h, i, j, k, l, m, n o, p, q, r, s, t, u v, w, x, y, z
|
|---|