in reply to Re: Perl and HTML
in thread Perl and HTML

SSI won't do the trick, because SSI doesn't give you the cookies information.

You *have* to generate the HTML from the CGI script somehow. If there's no dynamic information in the HTML itself do

open HTML,"<","/path to html" or die "Can't open html: $!"; print "Content-type: text/html\n\n",<HTML>; close HTML
At the end of the script. For a more general solution, see HTML::Template (or one of the other template modules) and CGI::Application. Or see Web Applications for a possibly helpful thread.

Replies are listed 'Best First'.
[OT] SSI and cookies
by bmann (Priest) on Jul 06, 2005 at 22:32 UTC
    SSI won't do the trick, because SSI doesn't give you the cookies information.
    Hi Joost,

    I've seen that statement several times now. Have you looked at $ENV{HTTP_COOKIE} in an included cgi?

    Are you talking about cookies and CGI.pm? If that isn't what you mean, would you explain in a little more detail?

        You can't set cookies from an SSI included script. (emphasis mine)

        Gotcha - the server will send the header based on .shtml or .html (or however SSI is configured). By the time the included file tries to set a cookie, the header is complete.

        That's what I was looking for. Thanks!