Anyone know how to execute a SSI / shtml directive in a Perl / CGI app?
I saw a few posts regauding this, but no one was able to solve it.
There is a really good reason for doing it:
If you have a template file that contains a SSI tag that you read in, you would need to parse that tag too. This way you can make several modular scripts instead of lots of big CGI programs.
A rough example:
index.shtml:
<HTML lang=en>
<HEAD><TITLE>Nested shtml Menu Test</TITLE></HEAD><BODY>
<!--#include virtual="/cgi-bin/hello.cgi"-->
</BODY></HTML>
hello.cgi:
open(DATA,"hello.template");
@template=<DATA>;
close(DATA);
print "Content-type: text/html\n\n"
for($a=0;$a<=$#template;$a++){
print $template[$a];
}
hello.template:
<!--#include virtual="/cgi-bin/nest.cgi"-->
nest.cgi:
print "Content-type: text/html\n\n"
print "<BR><B>Nesty Nest";
part of the problem I have faced is that custom directives in apache are not obeyed by CGI::SSI so i would like to rule out that module unless someone has some advice on a workaround.
-------------
update:
I found CGI::SSI_Parse which does almost everything I need. I am gutting the module to work the way i need. Ty for all the help!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.