Category Archives: Programming

Book Review: “Catalyst (Accelerating Perl Web Application Development)” by Johnathan Rockway

Catalyst is a web framework for Perl, which claims to "make web development something you had never expected it to be: Fun, rewarding and quick&quot.

I’m a professional Perl developer, but hadn’t tried Catalyst – it was one of the things I really wanted to try out but didn’t get round to it. Recently I obtained a copy of Johnathan Rockway’s book, Catalyst (Accelerating Perl Web Application Development) from PACKT publishing, so here’s a review of the book.

Johnathan is a member of the core Catalyst development team and certainly knows his stuff, so that lends credence to this book.

My first impression was that the book is somewhat thin at 187 pages for its £24.99 ($39.99 USD) cover price.

However, reading through the book, it covers Catalyst and some of the modules commonly used with Catalyst in just the right amount of detail – if you have some experience with Perl already, this book will give you just what you need to get using Catalyst with the minimum of fuss. The also covers various related tasks you’ll want to do when developing web apps with Catalyst, including:

  • using Template::Toolkit to generate output
  • object-relational mapping with DBIx::Class
  • generating forms automatically with FormBuilder
  • authentication and authorisation
  • session management
  • adding REST APIs, AJAX interactivity and RSS feeds

So, overall, I’d say it’s a quite good book, a perfect introduction to developing maintainable web applications using Catalyst, and using current best practices including MVC designs and ORM database access. However, one thing I felt wasn’t covered very well was Perl’s attributes which are used in many code examples – that’s one area of Perl that I haven’t really made any use of up until now. (The perldoc page does warn that "attribute declarations for variables are still evoving. The semantics and interfaces of such declarations could change in future versions. They are present for purposes of experimentation with what the semantics ought to be. Do not rely on the current implementation of this feature."). The book fails to really describe attributes at all (which I suspect is something a fair number of Perl developers won’t be familiar with). It also doesn’t explain the principles behind MVC design; I guess it’s a reasonable assumption that anyone planning to use Catalyst will probably already be fairly familiar with MVC principles, but a better introduction (perhaps with pointers to external reading for those needing to learn more first) wouldn’t have hurt.

Also, unfortunately the book is marred by several typos – it exudes a feel of perhaps being rushed out a little, without enough time being spent on editing. I don’t feel it detracts badly from the book, but is a little shoddy.

Despite the flaws, I still feel it’s a useful book to help get to grips with Catalyst.

Grab yourself a copy from Amazon (price at time of writing: £23.74), or buy it direct from Packt for £22.49.

New song lyrics search site

A whistling badger

I’ve been meaning to whack up a post about this – I launched a new song lyrics search website the other day called LyricsBadger.

It uses my Lyrics::Fetcher Perl module to fetch song lyrics from a variety of sites, and remembers what it’s been asked for before so that it can present lists of artists/songs which it’s already been asked for.

I built it as a testbed for Lyrics::Fetcher and to get some experience with Template Toolkit for Perl (which absolutely rocks!). The entire site is powered by one Perl script and a handful of templates, and uses a ScriptAlias directive to pass all requests to the one script so that it can provide nice clean URLs like /lyrics/Artist/Title.

Why not go and give LyricsBadger a try?

Grr, MySQL and enum types….

I want to stab MySQL between the eyes. Or rather if MySQL had eyes, I’d stab it squarely between them.

It just wasted far too much of my time with this bit of annoying behaviour. I’ll admit it was also my fault, but I still think MySQL reacted in a retarded way. (But then from a “database” system which on its default settings is happy to silently mangle data however it feels, that’s not too surprising).

Continue reading Grr, MySQL and enum types….

SimpleStreamer – Flash video streamer for Wii or PC

I recently got a Wii as a new toy, and wanted something good to stream videos to it.

I had a look round at some of the various “Media Center” options out there, but didn’t find anything I liked, so I’m writing my own.

So far I have a working system in Perl which allows you to browse the pre-set video dir(s) and presents a list of files + folders, when you select one it then uses a Flash streaming player, and either presents the file directly if it was a .flv video, otherwise it uses ffmpeg to transcode it to FLV on the fly and stream it to the Flash player.

Continue reading SimpleStreamer – Flash video streamer for Wii or PC

SMS::AQL 0.04 released

Finally released SMS::AQL Perl module">SMS::AQL v0.04 to CPAN last night, incorporating improvements kindly submitted by Ton Voon from Altinity.  Thanks Ton!

The changes include better parsing of server responses, documentation improvements, and a new test script using Test::MockObject to exercise the module without actually interacting with AQL or sending messages.   Brilliant stuff.

Altinity look to be a nice company  doing Open-Source data centre management tools, and actively support Open-Source projects by contributing code and bug fixes.

Lyrics::Fetcher v0.4.0 released to CPAN

Just released version v0.4.0 of Lyrics::Fetcher - a Perl module to fetch song lyrics">Lyrics::Fetcher to CPAN… it’ll take a little while to be distributed to the various CPAN mirrors.

Version 0.4.0 introduces the ability to automatically try all available fetcher modules until one suceeds, or pass an arrayref of fetchers to try in order.  Lyrics::Fetcher::LyricsNet has been removed from the package until it can be fixed up (the LyricsNet search doesn’t seem to work at the moment).