function getconfig( file ) local f = assert( io.open( file ) ) local ret = "return {" for line in f:lines() do ret = ret..line.."," end return dostring( ret.."}") end This is a bit tweaked. I wish that there was a YAML lib for Lua ;)