|
|
|
|
|
The globe.pm file is a Perl package that contains global variables are routines that are used in several other Perl programs.
Initially, there was only one program (voyant_nav.pl).
All variables were defined at the beginning of this program. This facilitated changing the value of external facing tags, such as the syntax of special HTML comment flags that the program needed to recognize.
Most variables were global to that program, because it reduced memory usage and confusion in naming/meaning when passed into routines.
During the development of the second program (voyant_indexer.pl), many of the variables were for external facing tags were re-used. It became a maintenance hassle to update these variables in multiple places.
A design decision was made to place these global variables into a single location, the globe.pm file. The reasoning was:
Passing these variables by value makes copies of the information in memory.
Passing these variables by reference is essentially the same thing as using them as a global variable but with potentially additional complications, such as variables changing names.
The call to the routine becomes more complicated when variables are passed in particularly when considering the significant number of HTML tags that the various routines need to recognize and handle.
Many of the variables are used in other programs and define tags that are specific to your environment. Placing the definitions in one place makes them easier to change.
Now, many of the Perl programs reference this package file which instantiates the variables. Then they can be accessed by any subroutine in the program. Whenever these are used in another All such global variables are prefixed with globe::.
In addition to the global variables, several routines that are used by more than one program have been relocated to this globe.pm file.
|
|
|
Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003
TP Tools v2-00-0a
# tpt-hug-02