Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

mod_perl caching problem

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


yingun at gmail

Jun 24, 2008, 6:07 AM

Post #1 of 6 (833 views)
Permalink
mod_perl caching problem

Hello,

Before asking here, I had read a few articles in perl.apache.org about
caching issue in mod_perl, but I still don't get it right with my
program when I had already changed the input, it still giving me the
result of old input. I aware that the child process will only compile
the code for once, but I had also read somewhere that it will
recompile when it found that the file has been changed. What I want to
achieve is the program should give me the result according to the
input at that time.

#this is the main entrance of my program
use CGI qw(:standard);
print header;

use Qwerq::Core;
our $qwerq = new Qwerq::Core();
$qwerq->query("what is the population of China");

How can I solve this problem ?

Thanks.


yingun at gmail

Jun 24, 2008, 6:55 AM

Post #2 of 6 (810 views)
Permalink
Re: mod_perl caching problem [In reply to]

I like to add on something, I had put the pragma
use strict;
use warnings;

on all modules that I had, but I didn't get the warnings of "Variable
"$foo" will not stay shared at..." .

What other possibility that might cause my program to cache the result
even when the input has already changed ?

Thanks.


geoff at modperlcookbook

Jun 24, 2008, 7:10 AM

Post #3 of 6 (815 views)
Permalink
Re: mod_perl caching problem [In reply to]

william wrote:
> I like to add on something, I had put the pragma
> use strict;
> use warnings;
>
> on all modules that I had, but I didn't get the warnings of "Variable
> "$foo" will not stay shared at..." .
>
> What other possibility that might cause my program to cache the result
> even when the input has already changed ?
>

http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my____Scoped_Variable_in_Nested_Subroutines

--Geoff


yingun at gmail

Jun 24, 2008, 8:22 AM

Post #4 of 6 (811 views)
Permalink
Re: mod_perl caching problem [In reply to]

Thank you for the reply,

That's one of the articles that I had read, but still I have not found
where my code having the "my scoped variable in nested subroutines" ,
I also aware of the nature of ModPerl::Registry would handle the code
in its subrountine called "handle". I have used global variable "our"
for the variables that might caused problem.

On 6/24/08, Geoffrey Young <geoff[at]modperlcookbook.org> wrote:
>
>
> william wrote:
>
> > I like to add on something, I had put the pragma
> > use strict;
> > use warnings;
> >
> > on all modules that I had, but I didn't get the warnings of "Variable
> > "$foo" will not stay shared at..." .
> >
> > What other possibility that might cause my program to cache the result
> > even when the input has already changed ?
> >
> >
>
> http://perl.apache.org/docs/general/perl_reference/perl_reference.html#my____Scoped_Variable_in_Nested_Subroutines
>
> --Geoff
>


perrin at elem

Jun 26, 2008, 11:05 AM

Post #5 of 6 (789 views)
Permalink
Re: mod_perl caching problem [In reply to]

On Tue, Jun 24, 2008 at 9:07 AM, william <yingun[at]gmail.com> wrote:
> Before asking here, I had read a few articles in perl.apache.org about
> caching issue in mod_perl, but I still don't get it right with my
> program when I had already changed the input, it still giving me the
> result of old input.

Are you still having trouble with this, or did you fix the problem?

- Perrin


yingun at gmail

Jun 28, 2008, 4:51 AM

Post #6 of 6 (762 views)
Permalink
Re: mod_perl caching problem [In reply to]

Hello, Sorry for the late of reply, I just solve it yesterday. It's
because a module of mine is using the global variable
our @array = ();

When I migrate from CGI to mod_perl, I forgot to fix that. Now I just
understand that because mod_perl only compile once, and the subsequent
execution of global variables are remembered. So I solved it by
reseting that global variable before that global variable is used.


Thanks.

On 6/27/08, Perrin Harkins <perrin[at]elem.com> wrote:
> On Tue, Jun 24, 2008 at 9:07 AM, william <yingun[at]gmail.com> wrote:
> > Before asking here, I had read a few articles in perl.apache.org about
> > caching issue in mod_perl, but I still don't get it right with my
> > program when I had already changed the input, it still giving me the
> > result of old input.
>
>
> Are you still having trouble with this, or did you fix the problem?
>
>
> - Perrin
>

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.