I Gotz Me a Dancer

Sometimes a good time means relaxing with CPAN, reading a POD of something and trying to learn it. At least for me.

Last weekend I treated myself to playing with KiokuDB and Dancer. I'll write on KiokuDB later, this post is on Dancer.

Dancer is a Plack-aware web application framework written by Alexis Sukrieh. It has a built-in simple templating system, but supports Template::Toolkit (a must for me), routes handlers (named matching, regex matching, wildcard matching), simple rapid prototyping and support for multiple configurations and allows separate configurations for separate environments and stages of the software.

After playing with it for a rather short time, I already implemented CRUD. The code comes out clean (which I love), understandable and simple. Pure joy. You should totally check it out!

The only problem is that I want to write an interface which will be hosted on someone else's computer, which only supports CGI. I have no idea how to run it as CGI. Any ideas?

Update: Alexis Sukrieh wrote on how to do this here. Next post will reflect this!


If you're using Plack, aren't you able to choose what method to use, FastCGI, CGI, etc.? I don't personally know the ins and outs but I had the impression that you can swap in a different method quite easily.

Nick is right, Dancer supports PSGI/Plack, and PSGI/Plack can run the application under CGI with its backend Plack::Server::CGI.

So all you have to do is to write a CGI script like explain in the POD of Plack::Server::CGI and make a RewriteRule appropriately.

I'm going to post a quick howto about that on my blog soon

Leave a comment

About Sawyer X

user-pic Gots to do the bloggingz