On 10/24/07 10:39 AM, Perrin Harkins wrote:
> In mod_perl 1, you can only store pnotes at a request level, so a
> subrequest has separate pnotes.  This meant you would need to lookup
> the parent request ($r->main) to get your pnotes.  In mod_perl 2, you
> have the option of using pnotes on a connection level instead of a
> request level.

Ah, that explains it.

> I recommend pnotes any time you need to pass data between mod_perl
> phases or store something that has to be cleared at the end of every
> request.  It's generally more reliable than using globals and manually
> clearing them in a cleanup handler.

Well, if we trust register_cleanup() to clean up db connections and so on,
why not trust it to reset globals too?  That's what I tend to do and it's
never let me down.

-John


Reply via email to