Should Perl 6 run MAIN if the file is required?
<p>Here's a short Perl 6 program that declare a <a href="https://docs.perl6.org/language/functions#index-entry-MAIN" rel="nofollow noreferrer">MAIN</a> subroutine. I should only see output if I execute the program directly:</p>

<pre><code>$ cat main.pm6
sub MAIN { say "Called as a program!" }
</code></pre>

<p>And I see output when I execute the program directly:</p>

<pre><code>$ perl6 main.pm6
Called as a program!
</code></pre>

<p>If I load it as a module, I see no output:</p>

<pre><code>$ perl6 -I. -Mmain -e "say 'Hey'"
Hey
</code></pre>

<p>Same if I <code>use</code> it from inside the program, I see no output:</p>

<pre><code>$ perl6 -I. -e 'use main'
</code></pre>

<p>But, if I use <code>require</code>, I get output:</p>

<pre><code>$ perl6 -I. -e 'require &lt;main.pm6&gt;'
Called as a program!
</code></pre>

<p><a href="http://design.perl6.org/S06.html#Declaring_a_MAIN_subroutine" rel="nofollow noreferrer">Synopsis 06</a> literally says <em>the compilation unit was directly invoked rather than by being required</em>. Is there something else going on because <code>require</code> works at runtime (although S06 doesn't exclude that)?</p>

<p>I get the same behaviour with Rakudo Star 2016.07 and 2016.10.</p>