in reply to What is the $c variable?
$c is standard shorthand for the application context in Catalyst. As AnomalousMonk said, the actual variable name is arbitrary, just as $self is but it's also a convention. In the case of your sample code, $self is the Controller object.
During a regular request cycle, in which all controllers participate, $c will have $c->request loaded and you can start writing a $c->response if you like (they both have shorthand too, $c->req and $c->res). In cases where the request has not been processed, like the base class of any Catalyst application or in pre-request configuration code, this convention is often used to disambiguate from the request cycle context: $ctx.
And I think you can start to see why Laurent_R's and my cautions about Catalyst as a first trip to Perlland are good advice. The journey will probably be more torturous than edifying. You have to know HTTP and Perl pretty well, including object oriented Perl, before you can even absorb the answers you'll get to your questions. And you haven't hit Models in Catalyst yet. Almost all the examples in the docs and most real apps use DBIx::Class which also has a steep and dissimilar learning curve.
Don't get me wrong. Catalyst is fantastic; as is DBIC. It's just not starter fare.
|
|---|