Why is perl6 regex ~~ trying to assign to immutable container?
<p>I am trying to extract the first name in a regex, but ~~ seems to want to assign to an immutable container. Why so? What did I do wrong?</p>

<pre><code>my $test= ' "DOE , JOHN" ';

grammar findReplace {
    regex TOP            { \s* &lt;ptName&gt; \s* }
    regex ptName         { &lt;aName&gt; }
    regex aName          { \" .+? \" }
}

class rsAct {
    method TOP ($/) { make "last name is: " ~ $&lt;ptName&gt;.made; }
    method ptName ($/) { 
        my $nameStr = $/.Str; 
        if $nameStr ~~ m/ \" (&lt;alpha&gt;+) .* \, .* \" / { 
            my $lastName = $/[0];   # I want $/[0] sub-string of outer $/
            make $lastName; 
    }
    }
}

my $m = findReplace.parse($test, actions =&gt; rsAct.new);
say $m.made;
</code></pre>

<p>and the error I got was this:</p>

<pre><code>Cannot assign to a readonly variable or a value
  in method ptName at shit.pl line 13
  in regex ptName at shit.pl line 5
  in regex TOP at shit.pl line 4
  in block &lt;unit&gt; at shit.pl line 20
</code></pre>

<p>I am trying to get a sub-string of the outer $/ that matches a pattern; why would ~~ be an assignment?</p>

<p>Thank you for your help !!!</p>