Re: Transitioning from Apache::Registry
On Mon, 3 Apr 2000, Drew Taylor wrote: In light of the recent "performance monger" thread, I am interested in information about transitioning from Registry scripts to Apache handlers. Here is my situation, which I'm guessing is pretty common. [...] use Search; use CGI; my $q = new CGI; my $action = $q-param('A'); my $object = Search-($CGI); if ($action eq 'R') { $object-searchResults; } elsif ($action eq 'S') { $object-Search; } That should be pretty easy to convert, since you already have your main program logic off in a separate module. Should I just use Apache::Request instead of CGI.pm? (I do use the cookie checkbox/pulldown functionality often). Use Apache::Request and Apache::Cookie (both in the libapreq distribution). I don't use the sticky forms stuff in CGI.pm, so I don't know if there's a handy replacement. Check CPAN or just roll your own. Maybe you could make a subclass of Apache::Request that adds somemethods for this. If there are any tutorials out there, I'd love some links. It really isn't difficult enough to merit a tutorial, in my opinion. It's just ordinary perl module stuff. - Perrin
Re: Transitioning from Apache::Registry
Perrin Harkins wrote: That should be pretty easy to convert, since you already have your main program logic off in a separate module. So I just write a small handler which does the same thing as the .pl script and add a Location /cgi-bin/search.pl directive to use this handler? That sounds very easy. :-) And I would need to setup a Location directive for each function (Search, Cart, etc)? Use Apache::Request and Apache::Cookie (both in the libapreq distribution). I don't use the sticky forms stuff in CGI.pm, so I don't know if there's a handy replacement. Check CPAN or just roll your own. Maybe you could make a subclass of Apache::Request that adds somemethods for this. I'll look into the forms stuff. I'm sure there is some equivalent in Apache::xxx modules. Thanks for the info. I've been writing perl for a couple years now, but the complete mod_perl experience is still new to me. -- Drew Taylor Vialogix Communications, Inc. 501 N. College Street Charlotte, NC 28202 704.370.0550 http://www.vialogix.com
Re: Transitioning from Apache::Registry
On Mon, 3 Apr 2000, Drew Taylor wrote: So I just write a small handler which does the same thing as the .pl script and add a Location /cgi-bin/search.pl directive to use this handler? Yes, that should work fine. And I would need to setup a Location directive for each function (Search, Cart, etc)? You probably want to set up one for each Apache::Registry script you have right now, unless you don't like the way they're structured and want to re-work it. - Perrin
Re: Transitioning from Apache::Registry
On Mon, 3 Apr 2000, Drew Taylor wrote: So I just write a small handler which does the same thing as the .pl script and add a Location /cgi-bin/search.pl directive to use this handler? Yes, that should work fine. And I would need to setup a Location directive for each function (Search, Cart, etc)? You probably want to set up one for each Apache::Registry script you have right now, unless you don't like the way they're structured and want to re-work it. Look into Perl sections to generate all the required configurations to save you redundant typing and errors. See http://perl.apache.org/guide/config.html#_Perl_Perl_Sections __ Stas Bekman | JAm_pH--Just Another mod_perl Hacker http://stason.org/ | mod_perl Guide http://perl.apache.org/guide/ mailto:[EMAIL PROTECTED] | http://perl.orghttp://stason.org/TULARC/ http://singlesheaven.com| http://perlmonth.com http://sourcegarden.org --
Re: Transitioning from Apache::Registry
Ahh yes, the Perl Sections... I've read briefly about them, but have not used it yet. Looks like I'll be learning it soon. I have many sites coming online in the near future that will have nearly identical setups like this one. Thanks Stas. Stas Bekman wrote: On Mon, 3 Apr 2000, Drew Taylor wrote: And I would need to setup a Location directive for each function (Search, Cart, etc)? You probably want to set up one for each Apache::Registry script you have right now, unless you don't like the way they're structured and want to re-work it. Look into Perl sections to generate all the required configurations to save you redundant typing and errors. See http://perl.apache.org/guide/config.html#_Perl_Perl_Sections -- Drew Taylor Vialogix Communications, Inc. 501 N. College Street Charlotte, NC 28202 704.370.0550 http://www.vialogix.com