Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Bingo. This is absolutely going to be a problem.
For those who saw that comment go over their heads, in mod_perl it is absolutely essential that global variables be declared with vars and not with my. The latter leads to serious black magic. Try RE (3): BrainPain-Help for one attempt at an explanation. Here is another. The key to the problem is that the subroutine has a single global name. There can only be one sub with that name in that package. Ever. However there may be many different lexical variables running around with that name. (Look up closures.) So when the one global has to figure out which lexical it names...well what is the right answer? This is an issue in this case because Apache is just wrapping your entire script with a sub, and calling that. So that sub is called many times, leading to many copies of the lexical variable, and the brand new one being set each time isn't being seen where you want it to be. In reply to Re (tilly) 2: Won't jump to Sub!
by tilly
|
|