in reply to Serving up static content with perl?

i doubt that SSI inside of CGI will work. but CGI inside of SSI will. let the server handle the html and insert your CGI for you.

<!-- /my-cgi.html the server SSI will run my CGI --> <!--#include virtual="/standard/header.html" --> <hr><h1>Check out my cgi!</h1> <!--#include virtual="/cgi-bin/my-cgi.pl" --><hr> <!--#include virtual="/standard/footer.html" -->

then your CGI can just be something simple.

#!/usr/bin/perl -T # /cgi-bin/my-cgi.pl # $factoid = "No matter where you go, there you are..."; print <<_HTML_; <p>Factoid of the day: <em>$factoid</em></p> _HTML_ exit;

Replies are listed 'Best First'.
Re^2: Serving up static content with perl?
by Aristotle (Chancellor) on Sep 23, 2002 at 07:16 UTC
    Be careful. This is not an exec cmd. If you exec cgi or (preferrably) include virtual, you have to emit appropriate HTTP headers.
    print <<_HTML_; Content-type: text/html <p>Factoid of the day: <em>$factoid</em></p> _HTML_

    Makeshifts last the longest.