Senph::PSGI
my $app = sub { my $env = shift; if ( my $match = $self->router->match($env) ) { my $req = Senph::PSGI::Request->new_from_env($env); my $ctrl = delete $match->{controller}; my $action = delete $match->{action}; if ( delete $match->{rest} ) { $action .= '_' . $req->method; } my $rv = $self->$ctrl->$action( $req, $match ); return $rv->finalize; } else { return [ 404, [], ['not found'] ]; } };