Re: preassigned names in pattern matches?

2017-03-14 Thread ToddAndMargo
On 03/14/2017 01:51 AM, Elizabeth Mattijsen wrote: On 14 Mar 2017, at 02:04, ToddAndMargo wrote: On 03/13/2017 02:21 PM, Elizabeth Mattijsen wrote: On 13 Mar 2017, at 22:17, ToddAndMargo wrote: I adore this feature of loops: perl6 -e 'my @x=qw[a

Re: preassigned names in pattern matches?

2017-03-14 Thread Elizabeth Mattijsen
> On 14 Mar 2017, at 02:04, ToddAndMargo wrote: > On 03/13/2017 02:21 PM, Elizabeth Mattijsen wrote: >>> On 13 Mar 2017, at 22:17, ToddAndMargo wrote: >>> I adore this feature of loops: >>> >>> perl6 -e 'my @x=qw[a b z y]; >>> for @x -> $a, $b {

preassigned names in pattern matches?

2017-03-13 Thread ToddAndMargo
Hi All, I adore this feature of loops: perl6 -e 'my @x=qw[a b z y]; for @x -> $a, $b { say "<$a> <$b>" };' because I can preassign a names to "$_". Question: in a pattern match such as: perl6 -e 'my $x="ab12cd"; $x ~~ m/(ab)(12)(cd)/; say