mesh#
Interleave multiple arrays, padding shorter ones with undef.
Registered under both mesh and mesh_longest. Both forms stop at the length of the longest input and fill missing elements with undef.
Σύνοψη#
my @out = mesh \@a, \@b, \@c;
my @out = mesh_longest \@a, \@b, \@c;
my %h = mesh \@keys, \@values;
Τι επιστρέφεται#
A flat list containing elements at position 0 from each input array, then position 1, and so on, up to the longest input. Missing positions are filled with undef.
Παραδείγματα#
my @r = mesh [1..3], ['a'..'c']; # (1,'a', 2,'b', 3,'c')
my @r = mesh [1..3], ['a'..'b']; # (1,'a', 2,'b', 3,undef)
my %h = mesh \@keys, \@values; # build a hash
Οριακές περιπτώσεις#
An input that is not an arrayref contributes only
undefs.Empty input list returns an empty list.
Διαφορές από το upstream#
Fully compatible with upstream.
Δείτε επίσης#
mesh_shortest- stop at the shortest input.zip- same lockstep walk, but yields one arrayref per row.