good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: splitting 2D array into chunksby BillKSmith (Monsignor) |
on Jun 21, 2021 at 20:21 UTC ( [id://11134131]=note: print w/replies, xml ) | Need Help?? |
I really do not understand your requirements. My best guess is you want to partition the array @arr1 according to the specification in the first column of array @a1. (and @arr2 according to the second column.) The 'end' indicies in @arr2 follow the math convention of 'start-at-one' rather than Perl's 'start-at-zero'. You are having a problem with the partitioning, not writing to files. The following code only does @arr1 and does not produce exactly what you expect. I hope you can use it as an example when you repost your question.
OUTPUT:
Bill
In Section
Seekers of Perl Wisdom
|
|