in reply to NEVER do this. Ever. Not even once.
in thread Variable Scope
Care to explain why?
For quite a long time (before we started Object-Orienting the project) we used global (::) variables to hold our internal database. Though I can understand why under certain circumstances it might not be wise, to that end we found it appropriate.(And there were mounds of vars there).
In fact, I have often found myself looking around in other people's code, trying to figure out which of the hundreds of hashes, arrays and scalar defined at the beginning of the script (outside the scope) they were referring to, and where they were changed. At least when they were ::'ed I knew I had to go chase them...
I appreciate the problems this can cause across packages, but sometimes your scripts standalone.
If I am missing something - please tell me,
--- perchance
For quite a long time (before we started Object-Orienting the project) we used global (::) variables to hold our internal database. Though I can understand why under certain circumstances it might not be wise, to that end we found it appropriate.(And there were mounds of vars there).
In fact, I have often found myself looking around in other people's code, trying to figure out which of the hundreds of hashes, arrays and scalar defined at the beginning of the script (outside the scope) they were referring to, and where they were changed. At least when they were ::'ed I knew I had to go chase them...
I appreciate the problems this can cause across packages, but sometimes your scripts standalone.
If I am missing something - please tell me,
--- perchance
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: NEVER do this. Ever. Not even once.
by chromatic (Archbishop) on Jul 31, 2001 at 04:02 UTC |
In Section
Seekers of Perl Wisdom