Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

•Re: Breaking output lines into N-element chunks

by merlyn (Sage)
on Apr 11, 2002 at 17:52 UTC ( #158371=note: print w/replies, xml ) Need Help??

in reply to Breaking output lines into N-element chunks

I prefer the easy-to-read idiom:
my @data = (... long list ...); while (my @chunk = splice @data, 0, 4) { # 4 items at a time ... process @chunk ... }

-- Randal L. Schwartz, Perl hacker

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158371]
[PriNet]: i guess i'll just have to use two seperate hashes, there are two, but one is larger than the other, and when i reference the smaller one, it holds onto the values that were assigned to the larger hash (the keynames change, but unless i reassign a new valu

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2017-06-28 03:04 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (619 votes). Check out past polls.