Not 100% sure what you're trying to do here.

In your first example, you're just giving the browser an HTTP redirect. The browser re-requests from the server the URL that you give it, so the server is in turn parsing the SSI embedded in the HTML as if the browser requested that page originally. That's probably the "best" way of sending the user to a different HTML page.

Your second example is keeping the user in your CGI but having the CGI script print out the contents of the file. Since your CGI script is not doing any interpolation/parsing of the data before it gets sent, no SSI can be handled, and the server will not post-parse your CGI output for SSI directives.p> In this latter case, if it's SSI features in Perl that you want, I don't believe there are any modules out there that will do this, so you'll have to roll your own. I'd see if Apache::SSI has something useful you can borrow. You'll probably end up having to use some regular expressions or even go so far as HTML::Parser if you want to be accurate about it, pull out the SSI "comments" and run them through your own code. There's got to be a better way of doing what you're trying to do, though.

Good luck.

Originally posted as a Categorized Answer.


In reply to Re: calling html by Fastolfe
in thread calling html by dakmatt

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.