++ed by:

65 PAUSE users
56 non-PAUSE users.

Marcus Ramberg
and 1 contributors


Catalyst::Manual::About - The philosophy of Catalyst



What is Catalyst? The short summary


  • Interact with a web server

    If you're on the web, you're relying on a web server, a program that sends files over the web. There are a number of these, and your application has to do the right thing to make sure that your program works with the web server you're using. If you change your web server, you don't want to have to rewrite your entire application to work with the new one.

  • Do something based on a URI

    It's typical for web applications to use URIs as a main way for users to interact with the rest of the application; various elements of the URI will indicate what the application needs to do. Thus, http://www.mysite.com/add_record.cgi?name=John&title=President will add a person named "John" whose title is "President" to your database, and http://www.mysite.com/catalog/display/23 will go to a "display" of item 23 in your catalog, and http://www.mysite.com/order_status/7582 will display the status of order 7582, and http://www.mysite.com/add_comment/?page=8 will display a form to add a comment to page 8. Your application needs to have a regular way of processing these URIs so it knows what to do when such a request comes in.

  • Interact with a data store

    You probably use a database to keep track of your information. Your application needs to interact with your database, so you can create, edit, and retrieve your data.

  • Handle forms

    When a user submits a form, you receive it, process it to make sure it's been filled in properly, and then do something based on the result--submit an order, update a record, send e-mail, or return to the form if there's an error.

  • Display results

    If you have an application running on the web, people need to see things. You usually want your application displayed on a web browser, in which case you will probably be using a template system to help generate HTML code. But you might need other kinds of display, such as PDF files, or other forms of output, such as RSS feeds or e-mail.

  • Manage users

    You might need the concept of a "user", someone who's allowed to use your system, and is allowed to do certain things only. Perhaps normal users can only view or modify their own information; administrative users can view or modify anything; normal users can only order items for their own account; normal users can view things but not modify them; order-processing users can send records to a different part of the system; and so forth. You need a way of ensuring that people are who they say they are, and that people only do the things they're allowed to do.

  • Develop the application itself

    When you're writing or modifying the application, you want to have access to detailed logs of what it is doing. You want to be able to write tests to ensure that it does what it's supposed to, and that new changes don't break the existing code.

Catalyst makes it easy to do all of these tasks, and many more. It is extremely flexible in terms of what it allows you to do, and very fast. It has a very large number of "plugins" that interact with existing Perl modules so that you can easily use them from within your application.

  • Interact with a web server?

    Catalyst lets you use a number of different ones, and even comes with a built-in server for testing or local deployment.

  • Do something based on a URI?

    Catalyst has extremely flexible systems for figuring out what to do based on a URI.

  • Interact with a data store?

    Catalyst has many plugins for different databases and database frameworks, and for other non-database storage systems.

  • Handle forms?

    Catalyst has plugins available for several form creation and validation systems that make it easy for the programmer to manage.

  • Display results?

    Catalyst has plugins available for a number of template modules and other output packages.

  • Manage users?

    Catalyst has plugins that handle sessions, authentication, and authorization, in any way you need.

  • Developing the application?

    Catalyst has detailed logging built-in, which you can configure as necessary, and supports the easy creation of new tests--some of which are automatically created when you begin writing a new application.

What isn't Catalyst?




Web programming: The Olden Days



for example, or

    foreach my $element (@query_elements) {
        # do something with your parameters, or kill yourself
        # in frustration for having to program like this



The MVC pattern






A simple example



How does this help you?







Jesse Sheidlower, jester@panix.com


Catalyst, Catalyst::Manual::Intro

