Web编程框架-Embperl
2011-02-28 12:48:10 阿炯

Embperl 是一个使用 Perl 来构建 Web 网站的框架。

初学者可通过简单设置即可实现在 HTML 页面中嵌入 Perl 代码,主要功能包括动态表、表单处理、会话处理缓存等等。



Embperl is a framework for building websites with Perl.

For the beginner it's an easy to setup and use way of embedding Perl code in HTML pages. It delivers several features that ease the task of creating a websites, including dynamic tables, formfield-processing, escaping/unescaping, session handling, caching and more.

If your demands grow it gives you the power to make your Website object-oriented and build it out of small reusable components. If you don't like the idea of mixing up all your layout and code then Embperl also supports separating it in different objects (e.g. creating an MVC application). Of course Embperl doesn't tie you to HTML - it allows components to be from different source formats (e.g. HTML, WML, XML, POD, ...) and if necessary transforms them (for example via XSLT) to other output formats. This is achieved by dividing the output generation into small steps, where each is processed by a plugable provider. Advanced users can create their own syntax definitions (for example tag libraries) and extend Embperl by writing their own providers and much more...

Embperl is a server-side tool, which means that it's browser-independent. It can run in various ways: under mod_perl, as a CGI script, or offline.

Embperl can be used under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

Features

Embperl facilitates embedding Perl code into HTML/XML or other text documents. Perl code is evaluated at the server side and the result is sent to the browser. All available Perl modules can be used without any restriction.

Allows to build Web sites out of small reusable components in an object-oriented way. Components can call and/or embed each other and inherit from other objects.

Standard layout of a web-site site can be defined once and the content can be dynamically generated by these components based on the uri. The documents need only contain the variable portions but not the common items which define the layout like headers/footers or navigation bars which normally form the template. Also these common elements can be overwritten in each sub-directory.

Embperl 2.0 thus facilitates separating code, layout and creating MVC (Model-View-Controller) applications. Control logic can be moved into an application object, which controls further execution of the request, while the actual pages are containing the display code. Simple applications can still embed all the code in the pages.

Source-code for each component can come from a different source, for eg. from file, memory or sub-request which allows to act on the output from another Apache application like PHP, JSP, CGI Script etc.

Each component can be in a different source format (e.g. HTML, WML, XML, POD, ...) and can be transformed to other output formats, say by using via XSLT.

Supports one or more scripting syntax using Embperl, ASP, Text, Perl and others.

Output generation is divided into small steps where each is processed by a plugable provider. The interaction of the providers can be individually configured for each component via recipes.

Supports caching of intermediate results and output.

Embperl encompasses several features that ease the task of dynamic web-site content generation, including dynamic-tables, form-field-processing, escaping/unescaping, etc.

Contains a module for easy form input validation, which is able to validate user input at the server side and on the client side by one definition of rules.

Handles per-user and per-module persistent session requiring only storage and retrieval of the session data from a special hash.

UTF-8 Support (honours Perl's internal UTF-8 flag during in- and output)

Offers flexible configuration options to suite individual tastes and needs.

Fully integrated into Apache and mod_perl to acheive the best performance. Can also run as a free standing CGI-script, off-line or can be called from another Perl program.

The Perl module DBIx::Recordset offers high level, easy to use database access for Embperl.

Embperl::Mail enables redirecting the result output to a mail-recipient.

Embperl::Inline allows to embedd Embperl code in normal Perl code

最新版本:2.4


项目主页:http://search.cpan.org/~grichter/

该文章最后由 阿炯 于 2013-05-10 09:49:40 更新,目前是第 2 版。