|
Now, my understanding of how modules work is that a module is loaded into a table, stored in a "packages" table, then a copy is also stored in the globals table of the enviornment it is loaded into, and another copy returned which can be stored in a differently named variable by the code calling require if desired. As lua doesn't work with references, if the module has a variable within it, then there will now by potentially 3 different copies of this variable.