Embedding Perl
July 17, 2000
Perl is not the first embedded scripting language that often comes to mind
for web developers. Microsoft popularized server-side embedded scripting
with their Active Server Pages, or ASP. Many developers who prefer not to
fall in line with Microsoft have migrated towards the open-source PHP
language, which is a powerful and very web-oriented language with
similarities to Perl, and is well supported by the dominant Apache web
browser. But the fact is that many developers are also experienced with
Perl, and there's no reason to learn yet another language when embedded Perl
would do the trick just as well.
Towards that end, there are no less than three embedded Perl projects that
are mature and available:
-
Mason is perhaps the most sophisticated and mature embedded Perl system.
Mason's main strength is the ability to construct "components" of
HTML/Perl which can be reused, as if subroutines or modules, in many pages.
Mason is especially popular for sites whose entire structure relies on
embedded Perl and HTML templates.
-
Embperl is similar in nature to Mason, with strengths leaning towards the
integration of HTML and Perl, such as output of tables from database queries
and processing of form fields.
-
Apache::ASP is a "port" of Active Server Pages for Apache and
mod_perl,
and uses Perl as the scripting language rather than Microsoft's
homebrewed scripting language. One of Apache::ASP's nice features is its CGI
compatibility, which is especially useful for scripts that have already been
developed using the CGI module, that you wish to use in an embedded
environment.
In introducing embedded Perl, we'll be focusing first on Apache::ASP. It's
backwards-compatibility with the CGI.pm module provides a natural stepping
stone from the CGI programming we've seen and used in this series.
The Embedded Advantage
The Perl You Need to Know
Apache::ASP -- Setup
|