|Page Path - Contents - Embperl|
HTML::Embperl (aka Embperl) is a Perl module that allows the execution of server-side programming code by embedding Perl code into HTML files. Embperl, written and maintained by Gerald Richter, can be found at perl.apache.org/embperl/.
A powerful feature of Embperl is that it is hooked into mod_perl. Most mod_perl features apply to Embperl, so if you know mod_perl, you need only a bit more to use Embperl. As in mod_perl, the code in the page compiled only the first time it is called (or when the file is modified), as is the case with Apache::Request programs with mod_perl.
The result of the compilation is cached so that the next time the page is requested, the Perl code does not need to be recompiled. It is the Perl code compilation that is cached, not the generated HTML code. This meas that the next time the page is requested, the Perl code reexecutes (but does not recompile) to generate the HTML for that request. If the HTML file is modified, a recompile is forced, but that is a Good Thing because we want the changes to take effect. After the recompile, the Perl code is again cached. This makes for efficient execution. Also, as in mod_perl, the internals of Apache are available to use if we want them, so Embperl can hook into Apache's different phases (such as authentication and logging) if the application warrants it.
Embperl is basically Perl code - and you know how we feel about Perl. You can write Perl server-side programs embedded within HTML files. Mmmmm, Perl...