Perl-Sensitive Sunglasses | |
PerlMonks |
Re: Adding an new element after every 5th element in arrayby thezip (Vicar) |
on Nov 27, 2013 at 00:31 UTC ( [id://1064504]=note: print w/replies, xml ) | Need Help?? |
I could't help but notice that your array just screams to be an array of arrays. I say this because it regularly repeats itself every three elements. I know this wasn't your original spec, but I offer the following advice. If you structured your array as:
... then you could easily add items to the end of each of sub-array by iterating and pushing:
What can be asserted without proof can be dismissed without proof. - Christopher Hitchens, 1949-2011
In Section
Seekers of Perl Wisdom
|
|