bcochofel has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have an index.html that includes files using the include directive from Apache mod_include. I have an header, menu and footer. What I want is to be able to include this files in a perl cgi script. How can I do this? I was trying CGI::SSI_Parser and using fssi($filename) but no good... I've tried:
use CGI::SSI_Parser; fssi("./header.html"); or sssi('<!--#include virtual="./header.html" -->');
I've also tried:
use CGI::SSI; $ssi = CGI::SSI->new(); $ssi->include(virtual => './header.html');
The code works great with my index.html file... I have XBitHack Full option under my httpd.conf apache

Replies are listed 'Best First'.
Re: CGI SSI and Apache2
by olus (Curate) on Nov 27, 2006 at 12:49 UTC
    Take a look at Template::Toolkit.
    It does what you want and alot more you don't know yet you'll need in the future.

    -----
    olus
Re: CGI SSI and Apache2
by perrin (Chancellor) on Nov 27, 2006 at 19:04 UTC
    With Apache2, you don't need to use workarounds like this. It is capable of processing SSI in your CGI output. Look at the mod_include docs.