in reply to mashing two arrays
Make an iterator that gets initialized with both arrays and keeps an index for each of them.
This iterator would always return the next date_time and undef or a value from either @foo or @bar. The index into either of the original arrays is only incremented if the value is taken.
If you really need an array @baz you could fill it with the iterator.
This solution would work with any number of arrays (but would not make sense with only one).
You may find details, code snippets, etc. in "Higher Order Perl" reviewed on this site.
|
---|