24 abr 2011

CPAN Module review - Web apps

When I'm developing web applications, I use those frameworks that make my work easier. The size of the webs is not big and I have been working with CGI::Application for years. In a recent search, I have found Dancer. This framework handles the routes concept (an idea from Ruby's Sinatra); routes are paths which are binded to code. For example:

get '/home' => sub { 'Hi, this is home!' };

There are a lot of plugins available (database, logging, session handling, REST, AJAX, validation, templates, WebSocket, ...) at CPAN. You can write your own plugin by subclassing Dancer::Plugin.

The framework comes with a script that builds the skeleton of your application, with a nice structure in folders: views, libs, ... it takes seconds to start a new application.

I  definitely recommend Dancer to you. Just install and try!

21 abr 2011

Perl 5.14 - favourite features

Perl 5.14 is near to be released, and RC1 is out. I'm reading the perldeltas documents looking for nice features. First of all, I'd like to send my congratulations to this fantastic team of people who has done it possible.
Since Perl 5.13.6 (documentation), you can now use the keys, values, each builtin functions on arrays (previously you could only use them on hashes). In fact, this feature is available in Perl 5.12, but it was not documented in perldelta, and I'm using it now.

15 abr 2011

CPAN Module review - Exceptions

I would like to share with you those modules that I use when I perform come kind of tasks. I start this series with exception handling. And the "winner" is... Try::Tiny !
  • nice / sugar syntax
  • Devel::Declare based (no source filters)
  • simple
What's your favorite alternative?