Mark J. Reed wrote:
Ok, I dkimmed through the synopses again and didn't see this offhand.
If I have two arrays @a and @b and I wish to create a two-element list
out of them - a la Perl5 ([EMAIL PROTECTED], [EMAIL PROTECTED]) - what's the
correct way to do
that in Perl6? If it's still ([EMAIL PROTECTED], [EMAIL PROTECTED]), then
what do we call what
the \ is doing there, now that references are supposed to be a
behind-the-scenes automagical thing?
To expand on the previous answer, unary backslash as described in S03
captures its argument and various representations can be extracted. In
this case, you are capturing an array, and creating a list of arrays.
This is done by reference, we presume, but that detail is not available
to the programmer the way it was in P5.
Other forms of capture:
\$var; # Capture a scalar
\%var; # Capture a hash
\(...); # Capture parameters
\\$foo (as in Perl 5) is not a "capture to a capture", it simply acts
like \$foo.