Embperl has started as a Perl module for simply embedding Perl
into HTML and has grown to
a full featured system to build dynamic content (not only) under
mod_perl. The version 1.x focus on HTML documents, also it could be
used for any sort of ascii files, and brings a lot of features
especially useful in a web-environment. This features includes
handling of form data and dynamic HTML tables/lists, session management
and context sensitv escaping and unescaping. More over you can
break up your documents in small reusable components/objects and build
a object-oriented website out of such objects, by using inheritence and
specificly overriding parts of the page. Also Embperl can cope with pages
that are screw up by high-level HTML editors, so your designer can still
use there favorite tool.
Embperl 2.0, which is a complete rewrite of the Embperl core, is not
even much faster then 1.x, but adds new possibilities. You can extent
or define your own syntax, thus giving the chance to trigger actions
on certain tags or inventing your own tags (creating a taglib).
It is much more modularized, so specific steps could be replaced by
custom processor and more then one processor can act on a document
before it goes to the browser (just like a Unix pipe). To enhances
performance 2.0 indrocuces caching of the output or intermediate steps.
Due to this modularization, it is now possible, to replace Embperl parser
by an XML parser and to do XML processing, for example by pluging in
an XSLT processer in the processing pipeline.
Embperl 2.0 can utilize libxml2 and libxslt for XML and XSLT processing.
All versions of Embperl can be used offline (as a normal CGI script or as a module
from other Perl code), but its real power comes when running under
mod_perl and Apache. It's directly integrated with Apache and
mod_perl to achieve the best performance by directly using Apache
functions and precompiling your code to avoid a recompile on every
|How does it compare to other templating solutions ?||top|
Embperl is not the only processor for embedded Perl code.
I guess every second webprogrammer builds his own templating
engine. Most of them are very similar and easy, but do a
good job in a certain environment. Often after a while these
programmer discover, they need more features and that other people
in the same situation has already build a soltuion for their problems.
At the moment there are five widely used Perl modules for generating
dynamic web content (Embperl, Apache::ASP, HTML::Mason,
Template::Toolkit and AxKit). All of these have their special strength.
So why to use Embperl? We believe that Embperl, especialy the
version 2.0, covers all of the aspects of these modules and integrates them
in one module with addtionaly benefits that are unique to Embperl.
Addtionaly Embperl is the fastes of these solutions, because it's engine
is totaly written in C and is optimized for delivering dynamic content
A another competitor for Embperl is PHP.
PHP is developing a strong user base, because it is rumored to be easy
to learn, and was designed specifically for HTML. Also PHP is probably one
of the strongest open source alternatives to using Perl in your
HTML, it's target is very webcentric and you may discover at a certain
point that is has it's limitations when you try to realize great projects.
Also it's not true, like some anecdotal stories on the Web might want to make
you belive, that PHP is faster then Perl. Perl,
and therfore Embperl also, scales and performs very well for high end solution.
|Focus of this document||top|
This tries to be an introduction to the basics of Embperl.
perldoc IntroEmbperlObject gives you an
tutorial about how to build an object-oriented website.