Relevant Lua 5.3 manual section in case you want to know more about require: http://www.lua.org/manual/5.3/manual.html#pdf-require
The error says that handler is currently being loaded when it calls itself. Here's a possible workaround:
local Handler = {object = {}}
local workspace = {
shell.getWorkingDirectory().."dir1",
shell.getWorkingDirectory().."dir2"
}
function Handler.init()
local key, dir
for key, dir in pairs(workspace) do
local element
for element in fs.list(dir) do
local s, e = string.find(element, "%.")
local ext = string.su