15.5 Server Side Includes with mod_perl

Team-Fly    

 
Webmaster in a Nutshell, 3rd Edition
By Robert Eckstein, Stephen Spainhour
Table of Contents
Chapter 15.  Web Server Programming with mod_perl

15.5 Server Side Includes with mod_perl

Server Side Includes (SSI) are tags embedded directly into an HTML file that perform special functions. They are most commonly used for running CGI scripts and displaying the result; most web page counters are performed using SSI.

If you use mod_perl with mod_include (another Apache server module), you can embed Perl subroutines into SSI directives. For example:

 <!--#perl sub="sub {print ++Count}" --> 

The Apache::Include module lets you include entire Apache::Registry scripts:

 <!--#perl sub="Apache::Include" arg="/perl-bin/counter.pl" --> 

You could have used standard SSI to include a CGI script for the same purpose, but this way is faster. To use mod_include with mod_perl, you need to configure mod_perl to do so at compile-time.


Team-Fly    
Top


Webmaster in a Nutshell
Webmaster in a Nutshell, Third Edition
ISBN: 0596003579
EAN: 2147483647
Year: 2002
Pages: 412

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net