lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> I am familiar with the use of require to load modules, but what about
> loading single use files? For example, in my project I have a number of
> initialisation scripts that need to run just once. There is no need to
> keep the data for these files hanging around in package.loaded after
> they have run. Is this the sort of situation in which people would use
> dofile?

Sure. require is just a dofile that tries to load the file from standard
locations. It also ensures that a file is not loaded twice. --lhf