lindex has asked for the wisdom of the Perl Monks concerning the following question:

Ok here's my situation, Iam writing this node based engine (mysql etc etc) in perl. I want to have nodes (pages) with perl embed in them, now I dont want to go through the hassle of writing one my self, now Iam aware of the currently available packages out there for this (Apache::ASP, HTML::Mason, HTML::Embperl), but it cant seem to figure out how to make any act as a standalone interepter. This is important due to the code being called from a db entry. If anyone could shed some light on this issue for me I would appriecate it very much :)




lindex
/****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/

Replies are listed 'Best First'.
Re: Embed perl in html.
by merlyn (Sage) on Aug 26, 2000 at 09:50 UTC
      Update:

      Well it seems after a lil tinkering I found something that seems to work here it is:

      #!/usr/bin/perl -w use strict; use HTML::Embperl; my($code) = <<EOC; this is some code [- \$poop = "foo" -] [+\$poop+] EOC print $code,"\n"; HTML::Embperl::Execute( { input=>\$code, mtime=>1, req_rc=>undef() } );




      lindex
      /****************************/ jason@gost.net, wh@ckz.org http://jason.gost.net /*****************************/
Re: Embed perl in html.
by tenatious (Beadle) on Aug 26, 2000 at 22:06 UTC
    I believe that eperl is another way to do it. It takes a simple ascii text file and passes through the ascii while executing the perl code that it finds. (It uses simple delimiters to figure out what the perl code is)... You might want to check it out.

    http://theoryx5.uwinnipeg.ca/CPAN/data/eperl/eperl.html