/usr/share/doc/lua50/examples/undefined.lua is in lua50 5.0.3-7.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 | -- catch "undefined" global variables
local f=function (t,i) error("undefined global variable `"..i.."'",2) end
setmetatable(getfenv(),{__index=f})
-- an example
a=1
c=3
print(a,b,c) -- `b' is undefined
|