$::vars hash

Bradley Baetz bbaetz at student.usyd.edu.au
Wed Sep 18 23:26:22 UTC 2002


On Thu, 19 Sep 2002, Gervase Markham wrote:

> Bradley Baetz wrote:
> > What you also may not know is that global variables suck, and that the 
> > global version hash will be removed at some point :)
> 
> But in the mean time, you shouldn't reinvent the wheel by re-adding this 
> data to it in your CGIs.

Right, but if you add more stuff, expect be to be annoyed, mainly because 
it usually means a resdesign to fix...

> 
> > The reason for this is that this affects mod_perl'isation, with the gloabl 
> > var and so on.
> 
> Global variables are OK in mod_perl if they get emptied at the beginning 
> of each execution, right? So surely, if all our global variables are 
> part of $vars, that means we only have to empty/nullify one variable :-)

Sure. Where do you do that? Remember, the |require globals.pl| won't be 
run on every request....

(Yes, you can register a cleanup hook for mod_perl, and reset it there. 
Lets just not go there.)

Bradley




More information about the developers mailing list