[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] Perl from within HTML?



mod_perl doesn't allow for embedding Perl in and of itself although there
are modules that work *with* mod_perl or take advantage of a mod_perl
install to do so and do so faster.  mod_perl basically speeds up your cgi
transactions but adds a little overhead to apache overall.  I don't
understand all the details of forking and threading and all that stuff, but
what I understand is it uses some sort of caching functionality to speed up
the second and beyond request for a particular cgi.  Someone with a better
understanding may want to correct my brief (and maybe poor) description or
we may drop the subject since there is no mod_perl on Mac...or is there on
Tenon's webserver (can't remember the name)?

Anyway as to address embedding perl in an html document....
There is also embperl (sp?) and ePerl (as well as others I'm sure).  I have
used ePerl a bit. The only thing with ePerl is that it hasn't had an update
in a while.  While it works well, I did have some trouble with it last time
I used it.  with those you set up delimiters and your document will look
like...(where your delimiters are <? and !>)

------------------------------------
<html>
...
<body>
<h2 align="Center">Joe's WebSite</h2>

The time at Joe's house is
<!--start snippets of perl code -->
<?
$date = `date`; # If you're using a *n*x box
print "<blink>$date</blink><br>\n"; # blink tag just to be tacky
!>
<!-- end that perl stuff -->
...
</html>
---------------------------------------
The perl code would execute and only print to the browser that which is in
the 'print' statements or STDERR in case of errors.

ePerl can be had at www.engelschall.com.  The other embedded sort(s) of
Perl, mabye someone else can offer up, if that is indeed the topic of
interest.

>Date: Wed, 16 Feb 2000 16:25:54 -0500
>From: Adam Witney <witneya@nmripo.nmri.nnmc.navy.mil>
>Subject: Re: [MacPerl-WebCGI] Perl from within HTML?
>
>depoends on what you are trying to do.... you can run a perl cgi 
>script through a link:
>
><A HREF="myscript.cgi">Click me</A>
>
>or are you talking about some kind of embedded perl in a script? I 
>think there are ways to do this... I think mod_perl can do this, but 
>you have to be using an apache web server with mod_perl compiled in. 
>Others may exist but I don't know much about them...
>
>you may have to give more details of your task and the environment in 
>which you are working
>
>HTH
>
>adam
>
>
>>How can a Perl script be executed from within a HTML document?
>>
>>tedd
>
>
>
>==== Want to unsubscribe from this list?
>==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org
>
>------------------------------


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org