[Pdx-pm] modperl irritations

Austin Schutz tex at off.org
Thu Jun 3 12:26:13 CDT 2004


On Thu, Jun 03, 2004 at 12:25:26PM -0400, Michael G Schwern wrote:
> On Fri, May 14, 2004 at 01:33:25PM -0700, Austin Schutz wrote:
> > 	We run modperl to make our website run fast instead of crawl.
> > Unfortunately, occasionally modperl will seem to cache some of the data,
> > hosing the data on the site.
> 
> Smells like you have some globals or file scoped lexicals sitting around 
> that aren't getting reinitialized in an odd condition.  Perhaps if the
> program dies or otherwise gets into a wierd state your cleanup code doesn't
> get run.
> 
> An interesting way to deal with globals which should be reset on each run 
> through the program in mod_perl that I've seen done is to move them all into 
> a %GLOBAL hash (so $Some_Thing becomes $GLOBAL{Some_Thing}).  Then when the 
> program starts you simply do "local %GLOBAL" or "%GLOBAL = ()" and you know 
> everything's clear. 
> 

	An interesting idea. I finally did turn up a few globals, btw, in one
of the supporting libs. Somehow it never occurred to me before that there could
be bugs outside my own code :-)

	Austin



More information about the Pdx-pm-list mailing list