Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: equivalent of python's zip in perl

by Anonymous Monk
on Jan 31, 2012 at 18:30 UTC ( [id://951033]=note: print w/replies, xml ) Need Help??


in reply to Re: equivalent of python's zip in perl
in thread equivalent of python's zip in perl

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]], @_)); }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://951033]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2024-04-25 14:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found