Include file to CGI output using Server Side Includes

166 views Asked by At

I am trying to include a file using SSI to the output of CGI script. What is the proper way of doing that? I tried CGI:SSI module with this code and the file wasn’t included.

    use CGI::SSI;
    my $ssi = CGI::SSI->new();
    $ssi->include(virtual => 'logo.inc');

Or should I use Apache::SSI? If so, what is the simplest way of doing that?

Thanks!

1

There are 1 answers

0
insaner On

Is the filename/path correct? As stated, if your script is in /cgi-bin/ then your logo.inc must also be in /cgi-bin/. If it can't find the file, it can't include it. You might have meant to write:

$ssi->include(virtual => '/logo.inc');

if logo.inc is in your server's root directory.