Dancer – A perl web framework

Dancer is a very lightweight yet powerful web framework written in perl. Its objective is to be simple and minimal. Over a period of ten years I have developed lot of desktop applications in perl/tk. Its about 3 lakh lines. Now is the time to giveup desktop based applications and move on to web based. I have been evaluating many cms and frameworks. Most of them are heavy and gives you less flexibility. What I wanted was simple one which let’s me decide what I should do. Catalyst framework seems to be good but I found it to be to heavy both to learning and to develop. When I found dancer, I was quite satisfied. I have deployed few small applications with it and have no major issues.

What I liked about dancer was its route handling. You can simply map routes to subroutines and take care of all business logic and processing in the subs/modules you write. Few of the important features are

1. Good route handling
2. Template support like template-toolkit
3. Plugin architecture with lot of plugins already available
4. Session managment
5. Support to Plack/PSGI

Here is a simple piece of hello world

#!/usr/bin/perl
use Dancer;

get '/hello/:name' => sub {
return "Why, hello there " . param('name');
};

dance;

You can run this code like

perl mydancerapp.pl

And then pointing browser to localhost:3000/raman will return ‘Why, hello there raman’.

Dancer is under heavy development. Version 2.0 will be released soon.

You can see more details at perldancer.org

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: