Author image Mark A. Imbriaco


Apache::ePerl - Parse embedded perl code from HTML files on the fly


 # add this to srm.conf
 PerlModule Apache::ePerl

 #in access.conf
 <Directory /WWW/htdocs/eperl>
 SetHandler perl-script
 PerlHandler Apache::ePerl::handler


Documents in the /WWW/htdocs/eperl directory will be parsed by the Apache::ePerl handler, which will evaluate any embedded perl which has been coded in the document before sending the response to the client.


<html> <head> <title>demo-01: CGI variable usage</title> </head> <body> <h1>demo-01: CGI variable usage</h1>

Welcome user from <? print $ENV{'REMOTE_HOST'}; "; !>, nice to mee t you!

</body> </html>

Would return the following response to the client system:

<html> <head> <title>demo-01: CGI variable usage</title> </head> <body> <h1>demo-01: CGI variable usage</h1>

Welcome user from, nice to meet you!


</body> </html>


This implementation of ePerl differs from the implementation by Ralf Engelschall in a few ways. First, the ePerl interpreter will run as an Apache module in this case, and should be faster than the external binary, since no fork()ing is necessary. Secondly, all errors generated by ePerl code will be placed in the server's error log, rather than sent to the browser.

Also note, that all comments about this implementation should be directed to Mark Imbriaco <> and note Ralf Engelschall.


perl(1), Apache(3),


Mark Imbriaco <> ePerl Concept by Ralf Engelschall <> mod-perl by Doug MacEachern <>