just want to point out that the reason Rob says not to assign the variable local further down in a function is that whenever you call a variable (be it value or function), code will look from point of call and upwards in the tab hierarchy, which i find kinda useful.
For example:
local function callback(event) print(event.response) end network.request(url2,"GET",callback) local function callback(event) print(event.response) end network.request(url1,"GET",callback)
here i will get 2 different replies, as intended, even though i use the same function name twice.
recently i’ve been working with a lot of network calls, and it helps me keep things more organized, if i do it like that.
all my return functions are named callback, and exist above the requesting function itself.
dont know if this makes much sense, or if it is how it is intended to work in lua, but it is how it works 
I have never used a global variable yet.