in reply to Breaking output lines into N-element chunks
my @data = (... long list ...); while (my @chunk = splice @data, 0, 4) { # 4 items at a time ... process @chunk ... } [download]
-- Randal L. Schwartz, Perl hacker