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

Re: Adding an new element after every 5th element in array

by boftx (Deacon)
on Nov 26, 2013 at 19:54 UTC ( [id://1064459]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $element_size = 3;
    my $group_size = 10; #adjust as needed for 5th, 7th, etc.
    ...
    
    # UPDATE: added code to put remainder of @old_array onto @new if not
    # a full multiple.
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2024-04-23 15:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found