Dual-license your content for inclusion in The Perl 5 Wiki using this HOWTO, or join us for a chat on irc.freenode.net#PerlNet.

Perl frameworks

From PerlNet

Jump to: navigation, search

The following is a sample of some commonly used frameworks and libraries with active community support. As with all things Perl, there is always More Than One Way To Do It .. so your best bet is to read the wiki, join the mailing lists, and have a play with some examples to see what best suits your requirements.

If you're new to perl, you're best off beginning at the beginning before getting lost in frameworks ;-).

You can also learn more about Using perl with other languages.

Contents

Application frameworks

Application frameworks provide complete tools for building applications, generally leveraging existing modules on CPAN as well as providing a plugin architecture for specific extensions. Most frameworks enable a Model-View-Controller (MVC) pattern where there is clear separation between the model (internal data structures), the view (how the data is presented), and the controller (interaction with the model).

  • Catalyst .. a flexible framework (originally based on Maypole) with a very aggressive agenda to be a Perlish answer to Ruby on Rails. Articles: Catalyst by Jesse Sheidlower.
  • CGI::Application .. a framework for rapidly building web applications
  • Gantry .. A web application framework for Apache/mod_perl, CGI and Fast-CGI. Object oriented design allows for a pragmatic, modular approach to URL dispatching. Supports MVC and initiates rapid development, offering an organized coding scheme for web applications.
  • Maypole .. an MVC framework to simplify development of database-driven MVC apps, primarily using Class::DBI and Template::ToolKit. Articles: Build Web apps with Maypole by Simon Cozens.
  • Jifty for web application development

Templating libraries

Templating libraries generally focus on the delivery of content .. however there is some crossover possible with more complex tools like Mason which can integrate support for sessions, caching, and dynamic components.

N.B. For simpler applications Text::Template may be sufficient and easier to use

Object-relational database wrappers

These are libraries that save you from the tedium of writing a lot of basic SQL. There are several strategies for mapping databases to objects and objects to databases; for an aging comparison refer to the POOP (Perl Object-Oriented Persistence) overview.

  • Class::DBI .. a popular interface that essentially creates an OO class wrapping each table in a DBI database; numerous plugins available to extend functionality
  • DBIx::Class .. a recent implementation inspired by Class::DBI, but with better support for generating complex queries including joins, views, and aggregates.
  • Rose::DB .. a database abstraction layer that is focusing on performance
  • Tangram .. a toolkit for storing objects in a database (see also Class::Tangram

Common libraries

Common (and recommended) libraries which you'll eventually stumble across while using other perl frameworks.

  • DateTime .. a unified interface for handling date/time formats and calculations
  • DBI (Database Interface) .. the standard interface module for working with databases. Have a search for DBD:: on CPAN to find a more complete list of database drivers, including common databases and some esoteric formats like CSV, iPod, and Google.
  • POE (Perl Object Environment) .. a framework for creating event-driven multitasking programs in Perl
  • Perl Cache modules .. a common interface for caching data with a variety of implementations (memory, files, databases, ..)