E
Edward
Guest
I'm amassing quite a collection of global variables (mostly constants)
for some of my routines. So now I'm considering consolidating these
variables either into a global hash or perhaps into some sort of
variable-serving function. Is anyone already familiar with these
kinds of techniques? Can you share a small sample and your views on
the subject?
I'm leaning toward the variable-serving function (e.g.
myGetVar("MPP_w")) solution. However, I'm wondering what kind of
performance/memory hit to expect from setting a bunch of variables up
only to produce the value for one of them at a time. Sure I'll have
some global memory space clear, but this seems like it might be a bad
way to go. Alternatively I've considered having all my variables in a
global hash. I'm guessing this is what most people use to serve
global vars for their various packages.
for some of my routines. So now I'm considering consolidating these
variables either into a global hash or perhaps into some sort of
variable-serving function. Is anyone already familiar with these
kinds of techniques? Can you share a small sample and your views on
the subject?
I'm leaning toward the variable-serving function (e.g.
myGetVar("MPP_w")) solution. However, I'm wondering what kind of
performance/memory hit to expect from setting a bunch of variables up
only to produce the value for one of them at a time. Sure I'll have
some global memory space clear, but this seems like it might be a bad
way to go. Alternatively I've considered having all my variables in a
global hash. I'm guessing this is what most people use to serve
global vars for their various packages.