title: Lua "require" with global "local"?
body: <p>Clearly I have some mixed up, but I figured that by using something like this in "main.lua":</p>
  
  <pre><code>local module = require("module")
  local var = "I should be global?"
  printthis()
  </code></pre>
  
  <p>with module.lua containing something like:</p>
  
  <pre><code>function printthis()
      print(var)
  end
  </code></pre>
  
  <p>that <code>printthis(var)</code> would work fine, because now the module.lua code is <em>inside</em> main.lua, no? Instead, printthis has no idea what <code>var</code> is. I read it's good practice to use "local" on Lua variables when possible, but in this case, do I have to make <code>var</code> global or is there a way for module.lua's <code>printthis()</code> function to read <code>var</code> properly? </p>