in reply to equivalent of python's zip in perl

> Is there a well-know equivalent of python's zip in perl?

see zip and other functions in List::MoreUtils and please use <code> tags.

Cheers Rolf

Replies are listed 'Best First'.
Re^2: equivalent of python's zip in perl
by Anonymous Monk on Jan 31, 2012 at 18:30 UTC
    Eh, you ask Perl monks about python, you can't be surprised when they get the details wrong... To replicate the python zip's behavior:
    sub python_zip(\@\@;\@\@\@) { # Add more \@ to taste my $short = min(map(scalar(@$_), @_)); return &zip(map(@$_ == $short ? $_ : [@$_[0..$short-1]], @_)); }