Using Perl Extensions with SSIThe Zeus Perl Extensions offer a new SSI tag: #perl. This can be used as a simple way to embed the output of a Perl subroutine in an HTML page. Here is a trivial example:
When the SSI tag is evaluated by the server, it calls the Perl runner and asks it to evaluate the Perl code in the sub argument. Anything that this code prints to standard output will then be included into the document. Naturally, you should make sure to enable this capability only on virtual servers whose content authors are trusted. Consider a more complex example. A hosting company wants to insert random advertising banners into a set of pages that already use SSI. Each banner needs to be associated with an appropriate link. To do this, they write a simple configuration file containing image and link URLs, one pair per line, and use the following Perl handler to select a random pair to display.
When this code is put in $ZEUSHOME/zperl/local/lib/site_perl/RandomLink.pm, the .shtml pages can then invoke the handler like this:
|
Recently...
Other Resources
|





