in reply to Re^4: first steps with Mojolicious::Lite -- under
in thread first steps with Mojolicious::Lite

Once the under() sub is compiled, all following get() and post() etc calls get compiled as calling this under() sub first.

So

under sub { validate_cookie() }; get "/foo" => sub { my $c = shift; ... }; get "/bar" => sub { my $c = shift; ... };

is equivalent to

get "/foo" => sub { validate_cookie() or return; my $c = shift; ... }; get "/bar" => sub { validate_cookie() or return; my $c = shift; ... };
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'