-- load the requested file chunk = loadfile("FILENAME"); -- Remember what is defined in global scope g={} for n in pairs(_G) do g[n]=true end -- execute the loaded chunk chunk(); -- Now look again what is defined, pick only functions and print their names for n in pairs(_G) do if (not g[n] and type(_G[n])=='function') then print(n) end end