zip_shortest#
Walk multiple arrays in lockstep, stopping at the shortest.
Σύνοψη#
my @rows = zip_shortest \@a, \@b, \@c;
Τι επιστρέφεται#
A list of arrayrefs, one per row. Row i contains the i-th element of each input array - produced only while every input still has an i-th element. No undef padding.
Παραδείγματα#
my @r = zip_shortest [1..3], ['a','b']; # ([1,'a'], [2,'b'])
my @r = zip_shortest [1..3], []; # ()
Διαφορές από το upstream#
Fully compatible with upstream.
Δείτε επίσης#
zip/zip_longest- pad to longest instead.mesh_shortest- flatten the rows instead of wrapping in arrayrefs.