RE: Apache::Registry - END Block not being called when script reloaded
-Original Message- From: Chris D'Annunzio [mailto:[EMAIL PROTECTED]] Sent: Friday, January 12, 2001 3:25 PM To: [EMAIL PROTECTED] Subject: Apache::Registry - END Block not being called when script reloaded [snip] The usual behavior for Apache::Registry is to explicitly call the END block each time the script runs. However, I have found that if I modify the main script and then execute a request without restarting the server, the END block is not called in that 1st request where the script is reloaded. After the first request, the behavior returns to normal. Is this a known bug or is there some other reason for this behavior? Has anyone else encountered this? I am unable to reproduce this using the latest cvs + perl 5.6.0 under a bunch of different settings... are you using an old version of mod_perl and/or perl perhaps? if not, a small test case with relevant config info would help track it down... --Geoff
RE: Apache::Registry - END Block not being called when script reloaded
-Original Message- From: Geoffrey Young Sent: Monday, January 15, 2001 8:57 AM To: 'Chris D'Annunzio'; [EMAIL PROTECTED] Subject: RE: Apache::Registry - END Block not being called when script reloaded I am unable to reproduce this using the latest cvs + perl 5.6.0 under a bunch of different settings... are you using an old version of mod_perl and/or perl perhaps? if not, a small test case with relevant config info would help track it down... sorry - I didn't see your follow-up email with the relevant stuff... I was able to recreate your problem... others may have additional help or opinions, but I've never heard of anyone doing an END block that way... typically, you would preload any modules you use() using a startup.pl or PerlModule - I guess you aren't doing either one of these since that would cause the END block to be run when the server is shutdown (see the guide and this thread from last week for more info: http://forum.swarthmore.edu/epigone/modperl/nalclyskix) anyway, sounds like you may need to re-evaluate how you are doing things... --Geoff
Re: Apache::Registry - END Block not being called when script reloaded
Actually, upon further investigation I found that it is in fact all subsequent requests the the END block is not called. You can recreate the anomaly with the following module and script: Foo.pm: --- package Foo; END{ warn "END block running"; } 1; --- foo.mpl: --- #!/usr/bin/perl use Foo; print "Content-type: text/html\n\n"; print "Hello World"; --- Directions: Start the server in single server mode. Make a couple requests Change foo.mpl slightly and save it Make more requests without restarting the server You'll see the following in the log file (minus the comments indicating which request you're on): # 1st Request: END block running at /Foo.pm line 4. # 2nd Request: END block running at /Foo.pm line 4. # Change file and save at this point # 3rd Request and all subsequent requests: (nothing printed) Any ideas? -Chris On Fri, 12 Jan 2001, Chris D'Annunzio wrote: Hello, I'm running a script under Apache::Registry which uses a couple of custom object-oriented modules. The modules have an END block defined which contains some clean-up code that needs to be run every time a request is made. The usual behavior for Apache::Registry is to explicitly call the END block each time the script runs. However, I have found that if I modify the main script and then execute a request without restarting the server, the END block is not called in that 1st request where the script is reloaded. After the first request, the behavior returns to normal. Is this a known bug or is there some other reason for this behavior? Has anyone else encountered this? It's not a huge issue because I normally restart the server after I make a change, but it produced some unusual behavior that took a while to track down. Thanks, -Chris
RE: Apache::Registry - END Block not being called when script reloaded
Hi folks, I am running a CGI script under Apache/mod_perl using Apache::PerlRun. I constantly got warning messaegs similiar to the one showing below: [Thu Jan 11 18:45:49 2001] null: Prototype mismatch: sub Apache::ROOT::login_2ecgi::gettimeofday () vs none at /usr/lib/perl5/site_perl/5.005/i386-linux/Apache/PerlRun.pm line 343. My CGI scripts seem to work just fine since the compliant happened in flush_namespace. I think I know why it is happening: gettimeofday() in Time::HiRes uses function prototype in the module, but line 343 in PerlRun.pm *{$fullname} = sub {}; doesn't know anything about it. Is there a good way of fixing it? Thanks, Wenzhong