sub what_i_want : Local { $c->detach("login") unless $c->user_exists... roles... etc... do_interesting_restricted_stuff() } sub login : Local { if ( authenticated... ) { my $destination = $c->request->path eq 'login' ? $c->uri_for("/") : $c->uri_for( "/" . $c->request->path ); $c->response->redirect($destination); $c->detach(); } }