Perl Dancer2 Web Framework Updated
Written by Nikos Vaggalis   
Monday, 06 November 2023

Despite the project going back to 2009, the just announced release is 1.0.0. Let's look at this milestone release, adopting a retrospective attitude. Of course, we are talking about Dancer2 , the new generation of Dancer as a complete rewrite of Dancer1 based on Moo.

Currently, there are three popular Perl web-based frameworks: Dancer, Mojolicious, and Catalyst. The best choice for you will depend on your specific needs, but Mojolicious has been the most popular in recent years.

This question of which framework is best has been debated for many years, and I tried to settle it almost a decade ago by conducting a series of interviews with key members of each project. I wanted to understand each framework's strengths, weaknesses, and unique features from the perspective of its developers. If you want to check them out, you'll find the links at the bottom of this article in Related Articles

But this article is just about Dancer. Dancer is the most lightweight of all Perl web frameworks, as well as being the most beginner-friendly, it incorporates a DSL to make using it even easier. So if you are just starting to construct dynamic sites with Perl, then Dancer2 is still the recommended choice.

As a beginner, I chose Dancer and have fond memories of the experience. Back in 2014 I started out  by joining GeekUni's great "Dancer Web Development Course", which was in beta at the time. As a matter of fact, that course was so enjoyable and innovative that I decided to let others know too about it by documenting my journey in Geekuni Dancer Web Development CourseGeek Uni, an online training platform dedicated to Perl was and still is the brainchild of Andrew Solomon. While working in higher education Andrew was given the job of coordinating a course teaching hundreds of university students how to code and he looked into why its previous pass rates had been "abysmally low". Discovering the problem to be lack of feedback and help from teachers and came up with the a novel teaching methodology that, after several years of research and development, was transformed into online learning of real-world coding skills. Geekuni still offers two courses, Perl Essentials and Web Development, the latter of which was my first step towards Perl web development.

After graduating GeekUni, the gained knowledge was put in hibernation until I needed to build a personal full-stack Android project as part of Udacity's Android Nanodegree. It was about a concept web site that aimed to become a database for smart devices letting users to search for their ideal device (phone, tablet, smartwatch) by going through specialized criteria, such as the screen size of the device, the amount of megapixels the rear camera has, and so on. The Android part is a related application to offer a native mobile experience alongside the web-based one. More details on Insider's Guide to Udacity Android Developer Nanodegree Part 7 - Full Stack Android.

My app was released to the Play store as part of the course Capstone project requirements, but was later taken down due to Google updating its policies and eliminating on the grounds of:  "Missing or inaccurate target audience information". However, as it was just a proof of concept rather than it having any real commercial value, I wasn't worried that it was taken down. 

But back to Dancer. As prime contributor Jason Crome said while announcing the new version :

We're stable, and we've been stable for a long time, but this was never reflected in our versioning. If you're expecting big changes, you'll be disappointed that there aren't many on the technical side. Much of what's in this release involves adding some polish in spots, and smoothing out some jagged edges in others.

In other words, the v1. 0. 0 is the the stamp that marks the project's stability rather than projecting any new technical advances. With that said, the highlights of the release were:

Project wise:

  • GitHub Discussions enabled on a trial basis as a means to better provide support and greater interaction with the community.
  • Going forward, Dancer2 will adhere to the Semantic Versioning specification, making version numbering easier to understand.

  • The Perl Toolchain gang recently announced that going forward, they’ll be tracking the Perl of 10 years ago. Dancer's team has decided to follow suit stating:

That doesn’t mean we will deliberately break backwards compatibility; that doesn’t mean Dancer2 won’t run on old Perl versions, but if something breaks on a Perl more than 10 years old it does mean we (probably) aren’t going to support that. It also means that going forward you'll see some newer Perl idioms and keywords in the Dancer2 code, especially when it makes code easier to implement and understand. 

  • Contribution guidelines have been updated, providing new contributors with some more helpful guidance, and making expectations for contributions clearer.

Coding wise, the project was bumped up to minimum version of Perl to 5.14, some parts were deprecated and of course many bugs have been fixed.

For the financial sustainability of the project, the core Dancer2 team has partnered with TPRF to make it easier to accept donations. An attempt in 2015 to raise 15,000 Euro on Kickstarter by launching a book, which I documented  in "Help Kickstart First Ever PerlDancer Book" tanked when the target was not met. However, 2018 saw the publication of a book by Gabor Szabo about Dancer. See Single Page Application with Perl Dancer for my review the verdict of which was:

The book can be regarded as covering two different but closely related aspects of developing for the web. One is the coding part and the other is the backend infrastructure part. 

I would fully recommend the book to someone starting out with either Dancer or web development in general, but not to someone already having advanced beyond the basics since it isn't carrying the tips and tricks or advice that would take the intermediate user that extra mile further.

The book is still available on Leanpub and is still relevant today.

Everything said so far was about setting the context surrounding  the new release, but to conclude, the new version of Dancer2  reminds everyone about the project's dynamics and that Perl is not dead! On the contrary, it is very much alive and kicking, and projects like this testify to that fact.


More Information

Announcing Dancer2 1.0.0

Dancer2 on Github

Dancer2 Official

Related Articles

All About Dancer - In Conversation With Sawyer X

Mojolicious In Conversation With Sebastian Riedel

Catalyst And More - An Interview With Matt Trout


To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.


Amazon Bedrock Adds Support For Anthropic's Claude3 Opus

Bedrock, Amazon's fully managed service for building generative AI applications, has been enhanced with support for Anthropic's Claude 3 Opus Foundation Model.

JetBrains RustRover Now Commercially Available

JetBrains has announced the commercial release of RustRover, an IDE for Rust developers. The company describes RustRover  as combining advanced coding support with an integrated toolchain.

More News

raspberry pi books



or email your comment to: