Hello alwynpan, and welcome to the Monastery!
I’ve never used Catalyst, but looking through the documentation I found this in Catalyst::Manual::Tutorial::02_CatalystBasics:
sub index :Path :Args(0) {
my ( $self, $c ) = @_;
# Hello World
$c->response->body( $c->welcome_message );
}
...
The "$c" here refers to the Catalyst context, which is used to access the Catalyst application. In addition to many other things, the Catalyst context provides access to "response" and "request" objects. (See Catalyst::Runtime, Catalyst::Response, and Catalyst::Request)
No doubt the other monks will be able to provide a fuller explanation. In the meantime, hope that helps,