http://qs321.pair.com?node_id=378860


in reply to Perl executing SSI/ include virtual

You could try looking at the template for SSI tags, and if there is one, use do or eval to execute it. Here's an example:

open(DATA,"hello.template"); my @template=<DATA>; close(DATA); print "Content-type: text/html\n\n"; for my $line (@template) { # you should probably use an HTML parsing module # here instead of a regex if ($line =~ m/<!--#include virtual="(.*?)"-->/) { my $include = $1; do $include; } else { print $line; } }