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!