lua-users home
lua-l archive

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


On Sat, Mar 10, 2012 at 5:21 PM, Matthew Kettlewell <matt@kettlewell.net> wrote:
> lua: /home/matt/Projects/COTS/lua_libs/alt_getopt.lua:32: attempt to call

You didn't include your code, so I have to guess what it looks like
(its not part of lua, for sure).

> global 'print' (a nil value)
...
> Is there something special about module's that I need to be aware of?

If alt_getopt.lua uses module() at the top, and the second argument
isn't package.seeall, then it can't see the globals (print is a global
function). Either add package.seeall or precede the module() call
with:

local print = print
module("mymodulename")

Cheers,
Sam