=head1 NAME Catalyst::Manual::Tutorial - Getting started with Catalyst =head1 DESCRIPTION This document aims to get you up and running with Catalyst. =head2 Installation The first step is to install Catalyst, and the simplest way to do this is to install the Catalyst bundle from CPAN: $ perl -MCPAN -e 'install Task::Catalyst' This will retrieve Catalyst and a number of useful extensions and install them for you. This process might not be totally painless though, and you might want to look at CatInABox at L, especially if you are on a system that lacks a compiler. =head2 The very basics - Setting up the skeleton application. Catalyst includes a helper script, C, that will set up a skeleton application for you: $ catalyst.pl tutorial created "tutorial" created "tutorial/script" ... output snipped created "tutorial/script/tutorial_create.pl" This creates the directory structure, populated with skeleton files. =head2 Testing out the skeleton application You can test out your new application by running the server script that Catalyst provides: $ cd tutorial $ script/tutorial_server.pl [debug] Debug messages enabled [debug] Loaded plugins: .------------------------------------------------------------------------------. | Catalyst::Plugin::Static::Simple | '------------------------------------------------------------------------------' [debug] Loaded dispatcher "Catalyst::Dispatcher" [debug] Loaded engine "Catalyst::Engine::HTTP" [debug] Found home "/home/users/me/tutorial" [debug] Loaded Private actions: .--------------------------------------+---------------------------------------. | Private | Class | +--------------------------------------+---------------------------------------+ | /default | tutorial | '--------------------------------------+---------------------------------------' [...] [catalyst] [info] tutorial powered by Catalyst 5.67 You can connect to your server at http://localhost:3000 (Note that each line logged by Catalyst begins with a timestamp, which has been replaced here with "C<...>" so that the text fits onto the lines.) The server is now waiting for you to make requests of it. Try using telnet to manually make a simple GET request of the server (when telnet responds with "Escape character is '^]'.", type "GET / HTTP/1.0" and hit return twice): $ telnet localhost 3000 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET / HTTP/1.0 HTTP/1.0 200 OK Date: Mon, 07 Nov 2005 14:57:39 GMT Content-Length: 5525 Content-Type: text/html; charset=utf-8 Status: 200 X-Catalyst: 5.67 [...] Connection closed by foreign host. $ You can see the full welcome message by visiting http://localhost:3000/ with your browser. More trace messages will appear in the original terminal window: [debug] *** Request 1 (0.063/s) [2148] [debug] Arguments are "" [debug] "GET" request for "/" from localhost [info] Request took 0.046883s (21.330/s) .------------------------------------------------------------------+-----------. | Action | Time | +------------------------------------------------------------------+-----------+ | /default | 0.000000s | '------------------------------------------------------------------+-----------' The server will continue running until you interrupt it. The application can also be tested from the command line using the generated helper script, C