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

If I do this approach will it allow the read_config_files subroutine to modify the hash and the changes will be reflected across all other scripts that access the hash?
  • Comment on Re^2: Modifying/Accessing hash in separate script

Replies are listed 'Best First'.
Re^3: Modifying/Accessing hash in separate script
by Laurent_R (Canon) on Jul 23, 2015 at 13:48 UTC
    Yes, it should work (but why don't you test it?).

    Having said that, having a global hash shared among different program files is usually rather poor design. I can't say for sure, because we don't have enough details about what you are doing, but maybe you should share functions accessing to this hash (useing a module), or perhaps think about an OO-implementation.