Sloop is a single thread asynchronous, linux (epoll) based HTTP 1.1 server with a perl interface. It was written in C and perl and has an event driven API.

#!/usr/bin/perl
use strict;
use warnings;

use Sloop::Server;

my $Sloop = Sloop::Server->new();

my $page = <<END;
<!DOCTYPE html>
<html>
<body>
    <h1>Hello World</h1>
</body>
</html>
END

$Sloop->{handlers} = {
    '/' => sub {
        my $client = shift;
        $client->reply(\$page);
    }
};

$Sloop->run();

Requests are handled by cascading through the handlers hash. Some other features: