Generally, keeping state in global data is a design mistake. And simply changing the global state from global variables to a global hash doesn't fix it.
Instead you should re-think the design of your program. Some relevant general software design tips taken from On Coding Standards and Code Reviews that might help are:
In reply to Re: global variables vs global hash
by eyepopslikeamosquito
in thread global variables vs global hash
by swoop
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |