A piggy bank of commands, fixes, succinct reviews, some mini articles and technical opinions from a (mostly) Perl developer.

Catalyst controller basics

Create a controller module:

    myapp_create.pl Controller Foo

created "......../lib/Controller/Foo.pm"
created "......../t/controller_Foo.t"

Inside Foo.pm:

sub index :Path :Args(0) {
    my ( $self, $c ) = @_;
    $c->response->body('Matched XXXX::Controller::Foo in Foo.');
}

sub root :Chained('/') :PathPrefix :CaptureArgs(0) {
    # common stuff for this controller
}
                        
sub bar :Chained('root') :PathPart('bar') :Args(0) {
    my ( $self, $c ) = @_;
    # something
}