my @data = (... long list ...); while (my @chunk = splice @data, 0, 4) { # 4 items at a time ... process @chunk ... }
-- Randal L. Schwartz, Perl hacker
In reply to •Re: Breaking output lines into N-element chunks
by merlyn
in thread Breaking output lines into N-element chunks
by FoxtrotUniform
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |