Hi Steve, On Mon, 2004-01-26 at 08:18, Hemond, Steve wrote: > I now know to create an handler to automatically add a > header and a footer to any .html called in a certain location. This > forces me to go back to httpd.conf and add the handler setup there, and > restart Apache so the changes will take effect.
If you explain the approach you are using to add the header and footer, we can probably suggest a way to make it work automatically for all files under a certain directory or all files with a certain extension. > What if I need more > handlers? What if I need handlers for database transactions, etc? > Editing httpd.conf and restarting Apache everytime seems wierd to me. Most people don't mind, since this all happens during development and restarting only takes a second. If it bothers you though, there are various ways to avoid it. One is to use Apache::Dispatch, which maps URLs to modules automatically. Another is to use a system like Mason, Embperl, Apache::ASP, or Apache::Registry and set it up to handle all requests for a certain directory or file type. You may be wondering why it isn't as obvious as something like PHP, where you just edit the conf file one and then create .php files. The answer is that PHP is very limited in terms of the ways you can use it, while mod_perl allows a much broader set of options and can be configured in many more ways. > Couldn't I handle these details in simple .pl files? (Like having a .pm > acting as a library to my website, containing a bunch of well defined > functions). Of course. Just use Apache::Registry and write your .pl files the way you would write CGI scripts. They will work like CGI scripts, but much faster. > I browsed the web for some mod_perl example site (with source code so I > can understand how the content is handled) but didn't find anything. There are tons of code samples in the documentation on perl.apache.org, and there are more in the documentation for specific templating systems. You can also get one of the mod_perl books, which include lots of code. If you have more specific questions, ask away. - Perrin -- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html