luaL_register is not a 100% replacement for luaL_loadlib, since it doesn't accept the 4-th parameter (nupvalues). What is the recommended or "official" way of porting luaL_loadlib to Lua 5.1 in case upvalues are actually used? -- Shmuel