perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Topf <joc...@remote.org>
Subject Re: Dynamic Embperl
Date Thu, 13 Nov 2003 08:46:04 GMT
On Thu, Nov 13, 2003 at 06:44:37AM -0000, Peter Moran wrote:
> Is it possible for Embperl not to use *real* files ?
> 
> What I want to do is to save template files inside a DB which will have
> Embperl code within them - I want to be able to retrieve the templates
> within a perl script and then *compile* the page to produce the result.
> 
> Main difference between doing this in offline mode is I dont want a
> inputfile and a outputfile, just a input scalar (containg the template) and
> a output scalar (containing the compiled page)
> 
> 
> Is this doable ? I have been looking long and hard through the previous
> mails but to no avail.... any suggestions welcome.

There are really two problems here:
a) Compile something out of the database into Embperl. If it is only
   Perl code you can just use eval, but with Embperl code its another
   problem. I have no idea how to do this but maybe somebody else can
   help.
b) How to get apache/Embperl to call your script if it is not at the
   proper place. Here I am using this solution, explained by an example:
   I want to get the URL
     http://www.example.com/foo/bar/baz
   In rewrite this with Apache mod_rewrite to
     http://www.example.com/foo.html?path=/bar/baz
   And now I have an Embperl File foo.html which will do the right
   thing. With this solution you at least don't need the file any more.
   (But it is sort of ugly, because if something changes you always have
   to rewrite the Apache config file, so if somebody has a better
   solution, please tell me :-)

Jochen
-- 
Jochen Topf  jochen@remote.org  http://www.remote.org/jochen/  +49-721-388298


---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-help@perl.apache.org


Mime
View raw message