Click to See Complete Forum and Search --> : SSIs


aj_nsc
04-16-2006, 08:12 PM
Here's a tricky dilemma. I have a fairly dynamic site, most pages have their content printed by a perl script which reads an HTML template from a text file and simply puts the content in where there's a <!-content-> tag in the template....that's not the interesting part by the way.

I want to include SSIs in my template, but obviously, when a perl script spits out the page to begin with, the SSIs won't get parsed and they'll just show up as HTML comments.

Does anybody have an interesting way of getting out of this 'parser-pickle'?

Scriptage
04-18-2006, 11:50 AM
All you need to do is print all the output to a temporary file. You can then pipe this file, which will run it at the server and your server side includes will work:

open(FILE, "|somefile.pl") || die "Can't pipe: $!";

while(<FILE>){
print $_;
}
close(FILE);

If you want me to write you the temporary file thing, let me know.

Regards

Carl