Kennedy Clark > Catalyst-Manual-5.7021 > Catalyst::Manual::Tutorial::Appendices


Annotate this POD


New  11
Open  3
View/Report Bugs


Catalyst::Manual::Tutorial::Appendices - Catalyst Tutorial - Chapter 10: Appendices


This is Chapter 10 of 10 for the Catalyst tutorial.

Tutorial Overview

  1. Introduction
  2. Catalyst Basics
  3. More Catalyst Basics
  4. Basic CRUD
  5. Authentication
  6. Authorization
  7. Debugging
  8. Testing
  9. Advanced CRUD
  10. Appendices


This chapter of the tutorial provides supporting information relevant to the Catalyst tutorial.


You may notice that Pod indents example code with four spaces. This section provides some quick advice to "un-indent" this text in common editors.

"Un-indenting" with Vi/Vim

When cutting and pasting multi-line text from Pod-based documents, the following vi/vim regexs can be helpful to "un-indent" the inserted text (do NOT type the quotes, they are only included to show spaces in the regex patterns). Note that all 3 of the regexs end in 4 spaces:

"Un-indenting" with Emacs

Although there author has not used Emacs for many years (apologies to the Emacs fans out there), here is a quick hint to get you started. To replace the leading spaces of every line in a file, use:

    M-x replace-regexp<RET>
    Replace regexp: ^    <RET>
    with: <RET>

All of that will occur on the single line at the bottom of your screen. Note that "<RET>" represents the return key/enter. Also, there are four spaces after the "^" on the "Replace regexp:" line and no spaces entered on the last line.

You can limit the replacement operation by selecting text first (depending on your version of Emacs, you can either use the mouse or experiment with commands such as C-SPC to set the mark at the cursor location and C-< and C-> to set the mark at the beginning and end of the file respectively.


The main database used in this tutorial is the very simple yet powerful SQLite. This section provides information that can be used to "convert" the tutorial to use PostgreSQL and MySQL. However, note that part of the beauty of the MVC architecture is that very little database-specific code is spread throughout the system (at least when MVC is "done right"). Consequently, converting from one database to another is relatively painless with most Catalyst applications. In general, you just need to adapt the schema definition .sql file you use to initialize your database and adjust a few configuration parameters.

Also note that the purpose of the data definition statements for this section are not designed to take maximum advantage of the various features in each database for issues such as referential integrity and field types/constraints.


Use the following steps to adapt the tutorial to PostgreSQL. Thanks to Caelum (Rafael Kitover) for assistance with the most recent updates, and Louis Moore, Marcello Romani and Tom Lanyon for help with earlier versions.


NOTE: This section is out of data with the rest of the tutorial. Consider using SQLite or PostgreSQL since they are current.

Use the following steps to adapt the tutorial to MySQL. Thanks to Jim Howard for the help.


Kennedy Clark,

Please report any errors, issues or suggestions to the author. The most recent version of the Catalyst Tutorial can be found at

Copyright 2006-2008, Kennedy Clark, under Creative Commons License (

syntax highlighting: