Because if I have to type a variable name in two different files, my typo rate is fairly high. Therefore I really, really want to declare it in one file, and let strict.pm catch my typos everywhere else.But putting use vars($var) does not make any difference from putting our $var; at the top of the file for this, or as far as I know any other use. In other words, I just use our as a direct replacement for vars. And if you do, there really isn't any difference (except that vars has more awkward scope).
And I don't use attributes on global variables (I do use them on global subroutines, though).
update: or are you really adding to the same package from different files as much as that? I really do that once or twice a year.
In reply to Re^9: My globals are visable; but undef'ed
by Joost
in thread My globals are visable; but undef'ed
by Wiggins
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |