Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: how to seperate array after a certain number of elements?

by Roy Johnson (Monsignor)
on Sep 20, 2007 at 15:37 UTC ( [id://640162]=note: print w/replies, xml ) Need Help??


in reply to Re: how to seperate array after a certain number of elements?
in thread how to seperate array after a certain number of elements?

That refactors nicely:
my @myMainArray = map [ @myArray[$_ .. ($_+4 < $#myArray ? $_+4 : $#myArray)] ], map $_ * 5, 0 .. $#myArray/5;

Caution: Contents may have been coded under pressure.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (7)
As of 2024-03-29 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found