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

Re: Breaking output lines into N-element chunks

by mdillon (Priest)
on Apr 11, 2002 at 16:54 UTC ( [id://158362]=note: print w/replies, xml ) Need Help??


in reply to Breaking output lines into N-element chunks

I would do it like this:
while (@vars) { print "directive: "; print join " ", map munge_var($_), splice @vars, 0, 4; print $/; }

Update: if I were feeling crazy, I might instead do it like this:

sub print_directive { return unless @_; print "directive: "; print join " ", map munge_var($_), splice @_, 0, 4; print $/; &print_directive; } print_directive @vars;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 09:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found