in reply to Anonymous sub clarification

The code you posted is broken and I am no Mojolicious user (yet), but...

if you meant

get '/' => sub { my $c = shift; $c->render; } => 'index';

then it's the same as

get ('/' , sub { ... } , 'index');
( sub body shortened for clarity )

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
    Apologies for the missing brace. I am familiar with the fat comma I was just a bit confused by the way the code was written. Forehead slap moment, thanks for pointing out the obvious, it makes perfect sense now.