I'm fairly certain I'm doing this in the less than perfect way but at the moment I'm seeking a working solution, not necessarily the right way.

My site primarily uses SHTML (that is simple HTML files with the SSI Include element thrown in to insert template elements). Now I've added CGI form processing and would like to just output the success page.

I initially just ordered a $q->redirect($success_page) using CGI but in testing it's redirected me before completing the file upload.

More importantly, I don't seem to be handling errors as gracefully as I would like. I would like to be able to pull my template elements (header file, footer file, etc.) into the Perl CGI processing script to print when I have an error but I cannot do a simple 'open file, print it' dump because I use SSI includes in those files. I don't know how to do execute that the internal SSI in those pages (for example the footer file utilizes a SSI include of the site map).

In other words, I'd just like to have the Perl script completely handle the success or failure of the page and work like my SHTML files by being able to execute those files SSI.


In reply to Print SHTML from inside Perl Script by Praethen

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.