No such thing as a small change | |
PerlMonks |
Re^2: Joining Arrays? (perl6)by eric256 (Parson) |
on Dec 22, 2008 at 03:32 UTC ( [id://731957]=note: print w/replies, xml ) | Need Help?? |
Perl6 provides a pretty handy way to do this. It has X which I beleive is pronounced "cross" so that you can do: (source)
Which outputs the following on Rakudo already:
The $^a and $^b in the map block tell it to take two elements at a time, while the X in the parenthesis tells it to cross join the two arrays. Very very handy for this kind of thing. ___________ Eric Hodges
In Section
Seekers of Perl Wisdom
|
|