Perl Dancer is a light-weight web framework for Perl. This examples uses Dancer 1. For new projects you should use Dancer 2.

Install Dancer

First you need to install the Dancer module.

In the archive you'll find more installation methods depending on your situation.

Directory structure

├── bin
│   └──
└── lib

The two files:

The script to launch the application:


#!/usr/bin/env perl
use Dancer;
use App;

The application itself:


package App;
use strict;
use warnings;
use Dancer ':syntax';

get '/' => sub {
    return 'Hello World';


cd into the root of the project and type:

plackup bin/

You can then visit http://localhost:5000/ and see the "Hello World".