use strict; use warnings; use lib 'lib'; use YAML; use HTTP::Engine; HTTP::Engine->new(%{ YAML::LoadFile('config.yaml') })->run; my %karma = {}; sub handle_request { my $c = shift; if ($c->req->param('hoge')) { $c->res->body('ok'); } elsif ($c->req->param('red')) { $c->res->redirect('/?hoge=1'); } else { $c->res->body(<<'...');
... } }