You are correct. However, I believe the best practice is to local-ize the globals at the earliest opportunity (syshandler / lowest autohandler) so that nothing escapes to survive between calls, as opposed to clearing the globals at the beginning of the call. This will get you what you want without the worries that you (rightly) express.

HTH,
RJ Herrick

John (Versimedia Admin) wrote:

Im am considering using the MasonAllowGlobals option to avoid having to pass certain hashes to every function (the data is required all over the place). I have noticed that, similar to programming directly in mod_perl, the global data survives the apache fork -- so if I set this in Apache httpd.conf PerlSetVar MasonAllowGlobals "%siteData %siteConfig %privateData" and then set this once: $privateData{test} = 1; That on subsequent reloads of that process, $privateData{test} can pop back up (if it hits the same forked process). My question is -- is it safe to reset the global at the top of the autohandler? such as: <%init>
%privateData = ();
</%init>
-- this variable would only be alive to one fork at a time, right? I suppose the thing I would have to be careful of is A) that I do this and B) make sure that any code that does not hit he autohandler does not use this data? Thoughts? Thanks
-John




-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Mason-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to