Perl 6 Perl 6 today #52

The zip (Z) operator

The Z operator does pairwise combinations of elements from two or more lists:

> my @first = <Larry    Damian Audrey  Randal>
> my @last  = <Wall     Conway Tang    Schwartz>
> my @nick  = <TimToady conway audreyt merlyn>

> for @first Z @last -> $first, $last { say "$last, $first"; }
Wall, Larry
Conway, Damian
Tang, Audrey
Schwartz, Randal
continued...
Copyright © 2009
http://www.pmichaud.com/2009/pres/