Practical mod_perl / HTML Book /



previous page: 6.8.1. The @INC Array Under mod_perl
  
page up: HTML Version of the book
  
next page: 6.8.2.1. Restarting the server

6.8.2. Reloading Modules and Required Files


When working with mod_cgi, you can change the code and rerun the CGI script from your browser to see the changes. Since the script isn't cached in memory, the server starts up a new Perl interpreter for each request, which loads and recompiles the script from scratch. The effects of any changes are immediate.

The situation is different with mod_perl, since the whole idea is to get maximum performance from the server. By default, the server won't spend time checking whether any included library modules have been changed. It assumes that they weren't, thus saving the time it takes to stat( ) the source files from any modules and libraries you use( ) and require( ) in your script.

If the scripts are running under Apache::Registry, the only check that is performed is to see whether your main script has been changed. If your scripts do not use( ) or require( ) any other Perl modules or packages, there is nothing to worry about. If, however, you are developing a script that includes other modules, the files you use( ) or require( ) aren't checked for modification, and you need to do something about that.

There are a couple of techniques to make a mod_perl-enabled server recognize changes in library modules. They are discussed in the following sections.

 

Continue to:

  • prev: 6.8.1. The @INC Array Under mod_perl
  • Table of Contents
  • next: 6.8.2.1. Restarting the server







TOP
previous page: 6.8.1. The @INC Array Under mod_perl
  
page up: HTML Version of the book
  
next page: 6.8.2.1. Restarting the server


Menu

  • HTML Book
  • PDF Book
  • Download Code
  • Table of Contents
  • Errata
  • mod_perl2 User's Guide
  • Sitemap

Search


Add to Google




Creative Commons License


Written by
Eric Cholet (Logilune) and
Stas Bekman (StasoSphere & Free Books).


[ Privacy Policy | Terms of Use | About Us | Search ]

© 2007 StasoSphere.com