Catalyst is just another MVC framework. This page contains contents non-Catalyst, e.g. CSS, AJAX, etc.



Get alternating rows in a table with TT2 and CSS

Use filters in TT2

define filters in

    FILTERS => {
                'floatprint' => [sub {sprintf "%6.3f", @_;}],

use it in the template,

[% temp.temp00 FILTER floatprint %]


$c->log->info("Starting the foreach loop here");
$c->log->debug("Value of $id is: ".$id);

Catalyst setup on Windows

need nmake and a C compiler (from such as Dev-C++)

Catalyst test

run with "-r" when testing for auto-restart when file is modified

mod_perl2 and Catalyst on Windows

mod_perl2 can be installed using ppm, this can be easily found.

to setup mod_perl work with Catalyst, some example can be found here. don't forget to get Catalyst::Engine::Apache.

part of the httpd.conf file:

PerlSwitches -IG:\temp\X\lib
LoadFile "C:/Perl/bin/perl58.dll"
LoadModule perl_module modules/

PerlModule X
<Location />
    SetHandler          modperl
    PerlResponseHandler X

suppose G:\X\lib\ being the Catalyst application.


  1. Catalyst::Manual::Tutorial
  2. Catalyst::Example::InstantCRUD

create m/v/c

script/ controller Books
script/ model MyAppDB DBIC::Schema MyAppDB dbi:SQLite:myapp.db '' '' '{ AutoCommit => 1 }'
script\ view MyChartStrip Chart::Strip

use regular expressions in the controller

sub monRun : LocalRegex('^mon(\d+)') {
    my ( $self, $c ) = @_;
    my $RUN = $c->req->captures->[0];
    #$c->response->body("captured $RUN");

css reference

generate schema automatically

perl -MDBIx::Class::Schema::Loader=make_schema_at,dump_to_dir:./lib \
-e 'make_schema_at("SpinDBSchema", { debug => 1 }, [ "dbi:Pg:dbname=spin_scratch"])'


ttsite.css and tt2 files for the views are at root/src, layout, header, footer, etc are found at root/lib/site/, sitewide data can be defined in are in root/lib/config/main


HTML Reference

JS and DOM reference for gecko

AJAX in view

some simple examples:


ab -n 100 -c 10 localhost/page?param=value


right now I'm using Catalyst on Linux with Postgres/Apache2/mod_perl

lighttpd and fastcgi seems to be quite common too:

javascript, etc

very nice tutorial on extjs data grid:

Inspect DOM, debugging CSS/JS/HTML, monitor network, etc:


Editor grid example