in reply to Anonymous sub clarification
if you meant
get '/' => sub { my $c = shift; $c->render; } => 'index';
then it's the same as
( sub body shortened for clarity )get ('/' , sub { ... } , 'index');
In other words, you are calling get with three parameters.
Please look up "fat comma", i.e. => is just a , with stringification of the left hand side.
In this case the => is just syntactic sugar, b/c no stringification happening here, but it reads better.
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Anonymous sub clarification (fat comma)
by epoch1 (Acolyte) on Jul 17, 2016 at 17:12 UTC |