Re: Is it me or is mod_perl extremely dangerous?

Perrin Harkins <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <CAC0_be0KDKUhYzZ=cSxR7ZPuDOsbRxT=o1Atb_Huk85TM5RSrA@mail.gmail.com>
On Mon, Dec 5, 2011 at 4:06 PM, Desilets, Alain
<[email protected]> wrote:
> I am scared witless by the fact that many variables don’t get reinitialized
> between calls to the CGI scripts.

It's harder to write safe code for persistent environments than it is
for CGI.  There's no question about that.  Unfortunately, you'll have
to get used to it, because nearly all web code written now is for
persistent environments.  The performance benefit is big enough to
outweigh the danger.

Keep in mind that the danger here is no greater than it would be for
someone using FastCGI, Java servlets, etc.  If you create persistent
variables (i.e. package variables declared without "my") you will have
to be responsible for clearing them when you want them cleared.

- Perrin
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.