in reply to Re^2: Modifying/Accessing hash in separate script
in thread Modifying/Accessing hash in separate script

Alright, you've now changed your original post, so that it is now clear to me that you have a main script and a required module. Maybe that was clear before your changes, but, if so, I clearly did not pick it up.

Well, in this case, yes, using the our function (instead of my) does make sense, it can make the variable available in both code files. Sorry if my previous answer was wrong, I did not understand the full context.

Although, to tell the truth, I am almost never using our to share variables between different compile units. I tend to prefer to create setter and accessor functions and to export explicitly these subroutines, rather than the variables.

Replies are listed 'Best First'.
Re^4: Modifying/Accessing hash in separate script
by mdskrzypczyk (Novice) on Jul 23, 2015 at 13:15 UTC
    I've tried adding the our keyword before the hash but it does not seem to have fixed the errors that get thrown in compilation. I still get the same Global symbol requires explicit package name error. Perhaps there is something else I need to do?