Why doesn't temp work in Perl 6 core settings?
<p>I was looking in  and saw this comment in the <code>indir</code> implementation:</p>

<pre><code>sub indir(Str() $path, $what, :$test = &lt;r w&gt;) {
    my $newCWD := $*CWD.chdir($path,:$test);
    $newCWD // $newCWD.throw;

    {
        my $*CWD = $newCWD;  # temp doesn't work in core settings :-(
        $what();
    }
}
</code></pre>

<p>I thought this use of <code>my</code> was strange, which led to <a href="https://github.com/perl6/doc/issues/1082" rel="noreferrer">doc issue #1082</a> niggling about if <code>my</code> is actually lexical. I would have thought that <code>temp</code> would be more appropriate for user-level temporary changes to dynamic variables.</p>

<p>But now, I see this comment, but I'm not quite sure what it means. Is <code>temp</code> broken this deep? Is it not available here? Or is the comment just wrong?</p>

<p>If the comment is right, has this way of dealing with dynamic variables leaked up to the everyday programmer level because that is what some people have to do in the guts (and they got used to that?)</p>

<p>And, how low-level is this level really? It seems like all of Perl 6 should be available here.</p>