|
|
|
|
|
Many of the global variables migrated into more complex data structures consisting of a hashes of arrays. The reasoning was:
Special code needed to be written to handle each unique variable. The code was rather lengthy, hard to maintain, and hard to copy copied into other programs which might require similar functionality and variable definitions.
Many of the external facing identifiers which delineated information in, say, a generated HTML file had a start tag and an end tag. This requires two variables for every identifier that I wanted to catch. An array reduces the number of unique variable names by a factor of two.
Hashes of arrays can reduce the number of unique variable names even further.
By putting more complexity into the data structures, the code became simpler for what was required to fill the data structure, extract elements, or otherwise manipulate the data. Moreover, the code could be re-used and handle situations where tags might be (purposely) missing.
The complex data structures impose standards and conventions. In some cases, once the hash is defined in the globe.pm file, the code in the perl (.pl) file does not need to know the explicit keys into the hash, which further generalizes routines to manipulate the hashes.
If you do not like some of my tag naming conventions for things that appear in HTML files (but not necessarily to readers), the globe.pm file is generally where they can be tweaked for your purposes.
WARNING! Even if the globe.pm file contained only variable definitions, it is a piece of code where syntax does matter. Be careful in making changes to definitions, otherwise other Perl programs wont work.
The variables and data structures in the globe.pm file have comments regarding which perl program uses them.
Note: If a given perl program doesnt work, it could be that the hard-coded path to the globe.pm file is invalid for your environment.
|
|
|
Open-Source tools compliments of Voyant Technologies, Inc. and Glenn C. Maxey.
01/13/2003
TP Tools v2-00-0a
# tpt-hug-02