Perl 6 Perl 6 today #33

The zip (Z) operator

Th 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 { say "$^b, $^a"; }
 Wall, Larry
 Conway, Damian
 Tang, Audrey
 Schwartz, Randal

> for @first Z @last Z @nick { say "$^c = $^a $^b"; }  
 TimToady = Larry Wall
 conway = Damian Conway
 audreyt = Audrey Tang
 merlyn = Randal Schwartz
Copyright © 2009
http://www.pmichaud.com/2009/pres/