in reply to SSI problem
Looking at this code, it already seems that you handle variables. So, let's see if we can get a SSI 'exec' in there, too.
Here is the code I just tested. It is a little different from the original (I removed the prototyping '()' from the function name, and changed the @_[0] to shift) just to make it work in my test.
sub DisplayHTML { $HTMLFileName = shift; open(HTMLFNH,"<$HTMLFileName") || die "ERROR: Can't open $HTMLFileName: $!"; print "Content-type: text/html\n\n"; while ($HTMLLine=<HTMLFNH>) { chomp $HTMLLine; $HTMLLine =~ s/(\$[\w\[\]{}']+)/'"'.$1.'"'/gee; if ($HTMLLine =~ /(.*?)<!--\s*#exec cmd=\"?(.*?)\"? -->(.*)/) { $HTMLLine = $1 . `$2` . $3; } print "$HTMLLine\n"; } close(HTMLFNH); }
It took a little work (on my part - still coming up to speed myself!), but this did test out in my scenario. Let me know if it works for you. I don't know if this is the 'best' way, but it is probably the easiest.
One thing I think I really have to say is that these SSI 'exec's can open a whole world of trouble, so be careful with the code the SSI is running.
D a d d i o
|
|---|