Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

•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?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158371]
help
Chatterbox?
[marto]: good morning all, TCIF
[robby_dobby]: marto: Good morning, I usually spend my Fridays here cursing the bloody weather!
[marto]: where are you based robby_dobby?

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2017-12-15 10:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (429 votes). Check out past polls.

    Notices?