I agree with Joost's recommendation for using subs for global variables. In addition to the points he made, this approach makes it easy to control the write status of the variable in different parts of your code, simply by creating one sub for an accessor and another for a mutator. Packages that import only the accessor will have read-only access, while others can have write access by also importing the mutator (assuming, of course, that the mutator is allowed to be exported in the first place).
In reply to Re: Global variables
by bobf
in thread Global variables
by polettix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |