@@ -662,7 +662,9 @@ I<Since version TODO.>
662662
663663Returns a list of array references, composed of elements from the given list
664664of array references. Each array in the returned list is composed of elements
665- at that corresponding position from each of the given input arrays.
665+ at that corresponding position from each of the given input arrays. If any
666+ input arrays run out of elements before others, then C<undef > will be inserted
667+ into the result to fill in the gaps.
666668
667669The C<zip > function is particularly handy for iterating over multiple arrays
668670at the same time with a C<foreach > loop, taking one element from each:
@@ -680,16 +682,17 @@ so make sure to invoke it with references to arrays.
680682For a function similar to the C<zip > function from C<List::MoreUtils > , see
681683L<mesh> .
682684
683- my @result = zip_longest ...
684685 my @result = zip_shortest ...
685686
686- These different variations of the function differ in how they behave when
687- given input arrays of differing lengths. C<zip_longest > will continue while
688- any of the inputs still have elements, inserting C<undef > into the result if
689- some input arrays have already run out. C<zip_shortest > will stop as soon as
690- the shortest input runs out of elements, discarding any unused ones.
687+ A variation of the function that differs in how it behaves when given input
688+ arrays of differing lengths. C<zip_shortest > will stop as soon as any one of
689+ the input arrays run out of elements, discarding any remaining unused values
690+ from the others.
691+
692+ my @result = zip_longest ...
691693
692- The plain C<zip > function is an alias to C<zip_longest > .
694+ C<zip_longest > is an alias to the C<zip > function, provided simply to be
695+ explicit about that behaviour as compared to C<zip_shortest > .
693696
694697=head2 mesh
695698
@@ -700,7 +703,9 @@ I<Since version TODO.>
700703
701704Returns a list of items collected from elements of the given list of array
702705references. Each section of items in the returned list is composed of elements
703- at the corresponding position from each of the given input arrays.
706+ at the corresponding position from each of the given input arrays. If any
707+ input arrays run out of elements before others, then C<undef > will be inserted
708+ into the result to fill in the gaps.
704709
705710This is similar to L<zip> , except that all of the ranges in the result are
706711returned in one long flattened list, instead of being bundled into separate
@@ -718,9 +723,10 @@ equivalent to C<List::MoreUtils::mesh> or C<List::MoreUtils::zip> (themselves
718723aliases of each other). This function does not apply a prototype, so make sure
719724to invoke it with references to arrays.
720725
721- my @result = mesh_longest ...
722726 my @result = mesh_shortest ...
723727
728+ my @result = mesh_longest ...
729+
724730These variations are similar to those of L<zip> , in that they differ in
725731behaviour when one of the input lists runs out of elements before the others.
726732
0 commit comments