title: Lua require doesn't work on directories
body: <p>I have been given some skeleton code for an assignment from my professor in lua. The code has several require statements that add packages to the current directory. The problem I am having is that many of these require statements are not requiring a .lua file, they require a directory containing many lua files. For instance, I have a directory qtwidget with a single file in it: init.lua</p>
  
  <p>In the skeleton code, this package is referenced like this:</p>
  
  <pre><code>local w = qtwidget.newwindow(width,height,"Energy surface")
  </code></pre>
  
  <p>So that's all fine and dandy, but when I run the skeleton code I get the following error:</p>
  
  <pre><code>dofile('/data/mar608/BigData/src/optim/demo2.lua')
  error loading module 'qttorch' from file '/usr/local/pkg/torch/share/torch/lua/qttorch':
  cannot read /usr/local/pkg/torch/share/torch/lua/qttorch: Is a directory
  stack traceback:
  [C]: ?
  [C]: in function 'require'
  /data/me/BigData/src/optim/demo2.lua:36: in main chunk
  [C]: in function 'dofile'
  [string "dofile('/data/mar608/BigData/src/optim/demo..."]:1: in main chunk
  [C]: ?
  </code></pre>
  
  <p>What's going on? Why doesn't lua understand this require statement? Is there any way I need to chance my package.path variable that will solve this problem? I need to be able to do this for many directories (i.e. specify the directories name and have lua load all it's files into a single name to be referenced later)</p>