On Sat, Feb 14, 2009 at 5:50 AM, André Warnier <a...@ice-sa.com> wrote: > Less nice, less neat, less classic, terrible style, whatever you want, but > which also works :
Yeah, I wouldn't really recommend this. Passing your $cgi object to subs that need it is the best solution. > I am not quite sure why it works, and I would appreciate if some mod_perl > guru could explain it. You're storing the CGI object in a global, and as long as your sub1 gets called on every request to put a new one in there before anything else tries to use it, it will work. If you ever try to use it before sub1 gets called, it will segfault. Not a very safe approach. - Perrin