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; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl executing SSI/ include virtual
by Avitar (Acolyte) on Aug 18, 2004 at 18:44 UTC |