lua-users home
lua-l archive

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


> I also tried require:
> 
>     require("scheduler.lua")
> 
> And got this error message:
> 
>     stdin:1: could not load package `scheduler.lua' from path `?.lua'

The path for "require" in Lua is different from the usual pathes.
(Should we change the name?) Instead of specifing directories (that do
not exist for Lua), it specifies very simple patterns, where a `?' is
replaced by the name of the module.

Because the standard path is `?.lua' (see the error message above),
require("scheduler.lua") will actually look for a file called
"scheduler.lua.lua". You sould change your code to require("scheduler"),
or else include a single "?" in the path; e.g.:

LUA_PATH = "?.lua;?"

-- Roberto