perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perrin Harkins <>
Subject Re: Bug with cgi->header() + mod_perl ?
Date Sun, 15 Feb 2009 18:22:13 GMT
On Sat, Feb 14, 2009 at 5:50 AM, André Warnier <> 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

View raw message