title: In perl mason what is the difference between .m file and .mi file?
body: <p>I would want to understand the difference between a .m file and .mi file in Perl/Mason.</p>
  
  <p>As per the mason components docs:</p>
  
  <blockquote>
    <p>.mi - internal component. An internal component can only be accessed from other components.</p>
  </blockquote>
  
  <p>I can see that i can call specific methods in written in a .mi file by </p>
  
  <p><code>$m-&gt;comp('test.mi:randomMethod', arg1=&gt; 'blah')</code></p>
  
  <p>Can i do the same for my .m file as well ? As all the existing places i searched online . i only found a file with no methods and the entire file is executed when called.</p>
  
  <p><code>$m-&gt;comp('test.m', arg1=&gt; 'blah')</code> runs the entire file as it has no methods. </p>
  
  <p>So, </p>
  
  <ol>
  <li><p>I want to know the difference between both file extensions</p></li>
  <li><p>Can i have methods similar to .mi file in .m file and call those methods specifically?</p></li>
  <li><p>When should i choose .m file and when .mi file ?</p></li>
  </ol>