|Perl Monk, Perl Meditation|
mod_perl - local vs my...by smullis (Pilgrim)
|on Nov 09, 2004 at 14:34 UTC||Need Help??|
smullis has asked for the
wisdom of the Perl Monks concerning the following question:
I have a mod_perl (v2) app that - among other things - reads a local config file based on the contents of an encrypted cookie value set by a frontend server. It all seems to work beautifully....
If I click stop / break the browser session while a page is loading then the subsequent requests seem to get themselves in a bit of a muddle (i.e. the results reflect the wrong config file).
After some reading here it seems that this code is the problem:
Are there any simple mod_perl recipes for ensuring that all variables are cleared on each subsequent page request?
Could it be as simple as using local within the function to force the variable to be undef when that block is left?
Or is there some other such Perl Magick I can employ...
Many thanks in advance for any pointers / tips / constructive criticism...
Apologies - When originally writing this question I left out some of the code thinking (incorrectly it seems) that it would confuse the issue...
Here it is in full...
I presume the suggestions of Ikegami are still relevant? i.e.:
After spending some time trying the solutions below I have had no luck. A Ctrl-f5 refresh (btw I have client side caching turned off and have set the relevnat Pragma: Nocache header vars) seems to make the mod_perl app randomly jump from one previously loaded config to another....
When I restart httpd it always works as expected.
Does anyone have any suggestions as to how I can force clearing all variables within the mod_perl app for subsequent request? I am using cookies for persistence but obviously I can set that each time the user instantiates the page...