Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Perl executing SSI/ include virtual

by beable (Friar)
on Jul 31, 2004 at 03:08 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2024-04-25 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found