[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: dofile vs require
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Fri, 2 Jun 2006 07:33:25 -0300
> 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