[mp2] Apache2::Reload doesn't reload
It seems like I've tried everything, and I can't get Apache2::Reload to reload my modules. I have a handler in a module called JetSet::Handler. That module depends on a number of other modules, which I've tried to include with 'use', with limited success. It seems, sometimes, symbols act just fine and reload when they should, but other times, I have to restart Apache in order to get the symbols to reload. I have run the Reload debugger, and it says everything is reloading just like it should. But, I believe my problem is described in the Apache2::Reload documentation; Apache keeps the old function pointer around from the first 'use', even though the changed function now has a new pointer. The Apache2::Reload documentation also says Registry (which I'm not actually explicitly using) doesn't play nicely with Exporter when 'use' is used, so I tried the 'require';'import()' method described in the documentation. With this, I'm unable to import my symbols. For example: # In Handler.pm: require JetSet::Debug; JetSet::Debug-import(); # ... JetSet::Debug::DebugLevel(JetSet::Debug::DEBUG_WARN); # End Where DEBUG_WARN is declared either by sub DEBUG_WARN() { 3 }; or with 'use constant' in Debug.pm. It is then exported in @EXPORT or @EXPORT_OK. Any combination of these things gives the following error. # From error_log: failed to resolve handler `JetSet::Handler': Bareword JetSet::Debug::DEBUG_WARN not allowed while strict subs in use at /home/cww/sites/rain/htdocs/jet-set/JetSet/Handler.pm line 19. # End I read in the list archives that doing away with Exporter altogether might be the preferred way of dealing with this. Implementing my modules as objects instead of exporting functions, it seems, might eliminate the not-exporting errors and make Reload work correctly: http://www.gossamer-threads.com/lists/modperl/modperl/82283#82283 I'm not opposed to doing that, but in that case, how does one deal with things like constants? Perhaps I would just have to keep all my constants in a single Exporter-style file and then restart Apache every time I change it? Frankly, that sounds like a pretty lousy way to have to deal with this. Here are some snippets that might help with the diagnosis. # From my virtual host configuration: PerlRequire /home/cww/sites/rain/htdocs/perl-static/startup.pl PerlModule Apache2::Reload PerlInitHandler Apache2::Reload PerlSetVar ReloadDirectories /home/cww/sites/rain/htdocs Location /jet-set SetHandler perl-script PerlResponseHandler JetSet::Handler /Location # End # startup.pl: use lib qw(/home/cww/sites/rain/htdocs/jet-set); 1; # End # Apache2 version string: Apache/2.2.3 (Debian) mod_ssl/2.2.3 OpenSSL/0.9.8e mod_apreq2-20051231/2.6.0 mod_perl/2.0.2 Perl/v5.8.8 Server at rain Port 80 # End Thank you for your assistance. Colin
Re: [mp2] Apache2::Reload doesn't reload
I've found Reload to work poorly on the handler sub -- i haven't been able to figure out why, but it just works poorly. To get around that, I just have the handler call/wrap other subs. package myapp; sub handler { $page= myapp::Page-new(); $page-whatever; } any changes go into myapp Page, or other modules. i never have to worry about the reload issues on the handler. pretty simple. // Jonathan Vanasco | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | CEO/Founder SyndiClick Networks | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | Founder/CTO/CVO | FindMeOn.com - The cure for Multiple Web Personality Disorder | Web Identity Management and 3D Social Networking | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | RoadSound.com - Tools For Bands, Stuff For Fans | Collaborative Online Management And Syndication Tools | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Re: [mp2] Apache2::Reload doesn't reload
Jonathan Vanasco wrote: sub handler { $page= myapp::Page-new(); $page-whatever; } So, Page.pm defines an object... do you have Page.pm including other Exporter-style modules? And, do those work properly? Thanks. Colin
Plat_Forms: Results and Survey
Hi mod_perl users, some months ago I asked for Perl web development teams for the Plat_Forms contest. Now the results are published: http://www.plat-forms.org/2007/results/ http://www.plat-forms.org/2007/documents/platformsTR.pdf The research team of the Free University of Berlin created a survey for professional web developers and asked me to forward you the following invitation. http://www.plat-forms.org/survey/ So, I hope that a lot of Perl users say them, why they use Perl ... ;-) Ciao Alvar -- Forwarded Message -- From: Florian Thiel ... Subject: Re: Plat_Forms: It's not over yet! Dear Perl web developers, We are currently researching the ways in which the major web development platforms differ and in addition to our work with the Plat_Forms contest, we're now looking for actual professional opinions. If you have practical experience in the development of non-trivial web applications with two or more web development languages then we would like you to participate in a short survey. Three Perl teams participated in this year's Plat_Forms contest but we would like to get a broader perspective. The questionnaire asks you about your experiences and opinions on two of the web development languages you have used, and should take about 10-15 minutes to complete. To thank you for your participation, you will be able to provide an email address and we will send you our final report when we are finished compiling it. http://www.plat-forms.org/survey/ We look forward to your answers and experiences, let me know via email if you have any questions. Florian Thiel [EMAIL PROTECTED] Plat_Forms survey team -- End Forwarded Message -- -- ** Alvar C.H. Freude, http://alvar.a-blast.org/ ** http://www.assoziations-blaster.de/ ** http://www.wen-waehlen.de/ ** http://odem.org/
newbie questions
I've been trying to convert our app over to mod_perl. Everything went smoothly except the cookies. When I load the page, some frames load and other don't. Below is the Perl function which prints out the headers. It's called before any template is printed. If I comment out the cookie lines, and print out an empty header the frames load perfectly, albeit without any session support. I'm sure this is a big time newbie question, but I'd appreciate some help... I've been googling around for quite a while. Thanks in advance. --Pubert my $bDidHeader; my $_cookies={}; # sub printHeader { # my $contentType = shift; $contentType = 'text/plain; charset=utf-8' if(!$contentType); my $cgi; my $sessCookie; if(!$bDidHeader) { my $objVP = VirtualPlant::getInstance(); if(! $objVP) { use CGI; $cgi = new CGI; $sessCookie = ''; } else { $cgi = $objVP-Cgi; $sessCookie = $cgi-cookie( CGISESSID = $objVP-Session()-id ); } if($sessCookie) { VirtualPlant::Util::setCookie($sessCookie); print $cgi-header( -cookie = values %{VirtualPlant::Util::getCookies()} ); } $bDidHeader = VirtualPlant::TRUE; } }