Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"

Re: Perl executing SSI/ include virtual

by beable (Friar)
on Jul 31, 2004 at 03:08 UTC ( #378860=note: print w/replies, xml ) Need Help??

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
    ya this is something like i was thinking of =) TY for your help!

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://378860]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2023-03-22 04:13 GMT
Find Nodes?
    Voting Booth?
    Which type of climate do you prefer to live in?

    Results (60 votes). Check out past polls.