[Pdx-pm] modperl irritations

Michael G Schwern schwern at pobox.com
Thu Jun 3 11:25:26 CDT 2004

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. 

Michael G Schwern        schwern at pobox.com  http://www.pobox.com/~schwern/
"He's cold-resistant, generally unemployed, and comfortable talking or
silent, and he knows how to read a map"
                -- Jenn Dolan

More information about the Pdx-pm-list mailing list