External Variable Error

In my game I want to keep my 2d arrays externally (there are a lot of them and they are huge)

I am trying this:

in main.lua:

dofile("arrays.lua") ... array\_1[currentRow][x] ERROR: attempt to index global 'array\_1' (a nil value)

in arrays.lua:

array\_1 =  {{0,0,1.0,0},   {0,2,0,1,0},   {0,0,0,1,0},   {0,0,0,1,0},   {0,2,0,1,0},   {0,0,0,1,0},   {0,0,0,1,0},   {2,0,0,1,0},   {0,0,0,1,0},   {1,1,0,0,0}}

When I put array_1 into main.lua everything works as expected. What am I doing wrong?

in main.lua:

[lua]

local data = require(“arrays”)

local array_1 = data.array_1

[/lua]

In arrays.lua:

[lua]

local d = {}

local array_1 = 
{{0,0,1.0,0}, 
 {0,2,0,1,0}, 
 {0,0,0,1,0}, 
 {0,0,0,1,0}, 
 {0,2,0,1,0}, 
 {0,0,0,1,0}, 
 {0,0,0,1,0}, 
 {2,0,0,1,0}, 
 {0,0,0,1,0}, 
 {1,1,0,0,0}}

d.array_1 = array_1

return d

[/lua]

in main.lua:

[lua]

local data = require(“arrays”)

local array_1 = data.array_1

[/lua]

In arrays.lua:

[lua]

local d = {}

local array_1 = 
{{0,0,1.0,0}, 
 {0,2,0,1,0}, 
 {0,0,0,1,0}, 
 {0,0,0,1,0}, 
 {0,2,0,1,0}, 
 {0,0,0,1,0}, 
 {0,0,0,1,0}, 
 {2,0,0,1,0}, 
 {0,0,0,1,0}, 
 {1,1,0,0,0}}

d.array_1 = array_1

return d

[/lua]