Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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


Comment on •Re: Breaking output lines into N-element chunks
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://158371]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2015-07-07 22:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (93 votes), past polls