<?xml version="1.0" encoding="windows-1252"?>
<node id="158371" title="•Re: Breaking output lines into N-element chunks" created="2002-04-11 13:52:47" updated="2005-07-21 01:31:16">
<type id="11">
note</type>
<author id="9073">
merlyn</author>
<data>
<field name="doctext">
I prefer the easy-to-read idiom:
&lt;code&gt;
my @data = (... long list ...);
while (my @chunk = splice @data, 0, 4) { # 4 items at a time
... process @chunk ...
}
&lt;/code&gt;
&lt;p&gt;-- &lt;a href="http://www.stonehenge.com/merlyn/"&gt;Randal L. Schwartz, Perl hacker&lt;/a&gt;&lt;/p&gt;
</field>
<field name="root_node">
158356</field>
<field name="parent_node">
158356</field>
</data>
</node>
