Referencing Objects in main lua

I currently have a main.lua and a command.lua subclass file in my program. I am trying to reference an object from my command.lua file that is in the main.lua and I am getting the follow error

"attempt to index global “yoh”  (a null value)

this is the line of code creating my error message    yoh:apllyLinearImpulse(0,40, yoh.x, you.y)

create a file. let’s call it myVar.lua

local M={}
return M

now at top of main.lua and command.lua add
myVar= require’myVar’

now any variables you need to share between files just do like this

myVar.yoh = yoh

then you can access them in other files by using

myVar.yoh:applyLi…

Than you! 

create a file. let’s call it myVar.lua

local M={}
return M

now at top of main.lua and command.lua add
myVar= require’myVar’

now any variables you need to share between files just do like this

myVar.yoh = yoh

then you can access them in other files by using

myVar.yoh:applyLi…

Than you!