I believe the 'use vars' pragma actually sets up GLOBALS, which very well could be
your problem. Scope them locally with 'my', which will keep them from getting
re-used with previous values on consecutive hits. Someone please correct me if I'm
wrong about the use vars bit...regardless, scope them with 'my' for sure.

Alternatively, you could use Apache::PerlRun as someone suggested earlier, wich just
keeps the perl interpreter spinning in memory and cleans out your (and your global
variables) by re-loading the script with each hit. Not as fast as pure
Apache::Registry, but still pretty damn good.

Also, try firing up apache in single user mode with the -X flag. Then hit the site
once and note your return values. Hit it once again and see if they don't get wacky
on you; bet they will. Then you'll know you've got values bleeding over from
subsequent requests. Refer to the mod_perl guide by Stas Bekman (man I'm giving his
site many plugs these days!) for a MUCH better explaination than mine.

Matt



--- Agustin Rivera <[EMAIL PROTECTED]> wrote:
> I'm sure I had a misunderstanding there somewhere ;)
> 
> This is the basic idea of what I'm doing..  I have a New Years Eve Concert
> Performance page I'm working on.  Similiar in construction to a typical page
> here at Pollstar, i.e.:
> http://www.pollstar.com/tour/searchall.pl?By=Artist&Content=Aerosmith
> 
> As good practice, we cache pages to reduce the load on our PostgreSQL
> databases.  The problem I'm having is that the script is recycling something
> in the cache routine that is causing the date-sort to be displayed during a
> city-sort, or a name-sort during the date-sort (you get the idea).
> Sometimes, it reports that its showing a cached page when their clearly are
> no cached files on disk.
> 
> Unfortunately, there is so much code and a few potential internal security
> risks (that I'm working on eliminating) in it that I can't simply cut and
> paste it.
> 
> I was under the idea that this line of code...
> use vars qw($template $file $cache $cachefile); would stop mod_perl from
> recycling those variables.  At least, thats what the local Linux guru told
> me.
> 
> Thanks to everyone helping me out.  It's time to do some reading...
> 
> Agustin Rivera
> Webmaster, Pollstar.com
> http://www.pollstar.com
> 
> 
> 
> ----- Original Message -----
> From: "Curtis Poe" <[EMAIL PROTECTED]>
> To: "Agustin Rivera" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Friday, December 07, 2001 3:48 PM
> Subject: Re: Disable ModPerl
> 
> 
> > --- Agustin Rivera <[EMAIL PROTECTED]> wrote:
> > > Is there a quick, simple command I can use to disable Modperl on all
> > > variables in script, without having to qw' then all?
> > >
> > > Agustin Rivera
> > > Webmaster, Pollstar.com
> > > http://www.pollstar.com
> >
> > Agustin,
> >
> > I think you have a misunderstanding here.  mod_perl is not "enabled" for
> variables.  The scripts
> > run in a mod_perl environment and can't have "parts" of them undone, so to
> speak.
> >
> > Perhaps if you were to share with us what you're trying to accomplish,
> what you're getting
> > instead, and the offending code, we may be able to help you.
> >
> > Also, this is probably better posted to the CGI Beginners mailing list
> ([EMAIL PROTECTED]).
> >
> > Cheers,
> > Curtis "Ovid" Poe
> >
> > =====
> > Senior Programmer
> > Onsite! Technology (http://www.onsitetech.com/)
> > "Ovid" on http://www.perlmonks.org/
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Send your FREE holiday greetings online!
> > http://greetings.yahoo.com
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________________________
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to