Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

•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]
[choroba]: Shouldn't you replace it with your app's name?
[james28909]: i figured it out
[james28909]: upon trying various solutions, i was forgetting to package up the script into an executable
[marto]: that'll do it
[james28909]: im glad im not in charge of anything important, like filling up peanut butter jars

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (8)
As of 2017-07-28 14:19 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (430 votes). Check out past polls.