London Perl Workshop 2008

by Peter Haworth

I had to get up at 5:45, to catch the 6:30 train. Despite the freezing weather, there were still revellers hanging around a couple of the clubs I passed on my way to the station, who had presumably been partying all through the night. I can only admire their stamina, regardless of its foolhardy application.

The trip to the venue was pretty uneventful, other than my surprise and disgust at the cost of a Zone 1 single fare. Four quid for a 15 minute journey! However, as soon as I got there, I was obliged to carry an incredibly heavy box of books up to the O'Reilly stand. I was a bit confused that all of Josie's boxes had Wiley's branding rather than O'Reilly's, despite their contents. What's the relationship there?

After a bit of random milling about, everyone headed into the main lecture hall for Mark Keating's introduction to the workshop, after which was Dave Cross's very entertaining history of London.pm. I especially liked the fact that this talk included a mention of the outrage caused in some parts of the community by the "Perl is my bitch" T-shirts, yet ended with the famous photo of Greg McCarroll and the camel, underlined by Dave's final words: "We f*ck camels!"

Leon Brocard gave a quick run down of 10 of his modules that he hasn't already talked about. My favourites were:

  • App::Cache, which caches arbitrary perl data structures for a set amount of time. Useful if you don't care about the size of the cache, and has a handy convenience method for transparently caching web pages
  • HTML::Fraction, converts strings like "1/5" into character references like "", as used in Leon's recipe database
  • Image::WorldMap, plots points on a world map image, with optional labels which don't overlap, as used by the Perl monger World Map
  • Term::ProgressBar::Simple, displays a progress bar controlled by a simple tied variable

David Cantrell tried to convince the masses that closures are actually simple, and extremely useful. His view is that they are basically code with data attached; the inverse of objects, which are data with code attached. He also made a good analogy between the class/object distinction and the sub/closure distinction. Unfortunately, the example from CPU::Emulator::Z80 focussed too much on the details of z80 emulation, and not enough on the benefits gained by using closures. The other example from Sort::MultipleFields was more lucid, but a diagram would have been a big help to anyone who can't convert from unfamiliar code to data structures in their head.

Adrian Witas was almost completely impenetrable when talking about Abstract::Meta::Class, which he was supposed to be presenting as an alternative to Moose, but didn't make that clear at all. In point of fact, he didn't make anything clear at all. AMC may indeed be the bee's knees, but Adrian failed to give any kind of rationale for its existence or its differences from Moose.

Mike Whitaker did a good job of introducing Moose, showing a bunch of cool features. Moose seems to do an excellent job of removing boiler plate code, and turning class construction into the kind of declarative affair which other languages enjoy.

Then I went to Matt Trout's talk on Acme::Yorkshire, which I was just expecting to be a surface-level explanation of a module which converted text to Yorkshire dialect, much like the Swedish Chef translator module which I can no longer find. Instead, it was a description of how Devel::Declare can be used to radically alter perl's syntax, enabling the creation of new control constructs such as:

method($foo,@bar){
  # $self is available, and there's no need for a trailing semi
}

It took me a while to acclimatise to Matt's presentation style, in which the slides at first didn't appear to match up with what he was gleefully bellowing about, but this was a fascinating, funny and frightening talk.

Due to the press of perl mongers in Subway at lunch time, I managed to get a free cookie, because the lone girl behind the counter couldn't spare the time to wait for me to find the correct change. That's the power of bulk buying!

After lunch, I went to Andy Wardley's "Badger Power" talk, which still not having read any of the abstracts, I was expecting to be about Template Toolkit. I've only briefly tried TT during an aborted rewrite of a major system at work, and would like to give it a better try at some point, so this seemed like it would be reasonably useful to me. However, Andy was actually talking about his new Badger lightweight foundation classes, which provide simple and consistent APIs for all manner of highly useful features: error handling, debugging, exporting, lazy loading, constant declarations, en/decoding, testing, file name and handle manipulation, and last but not least, class construction, which combines basically all of the above. This was a great presentation of what looks like an incredibly useful set of tools. Next time I need to create a new class, I'll probably use Badger.

I caught the last few minutes of Abigail's character class talk, which overran not only his scheduled slot, but also the intersession break. The bit I saw reminded me that perl allows you to create your own reusable character classes, which could cut down some level of repeated code, but I'm not sure it's of major use to me at the moment.

Abigail's overrun meant that Joel Berstein's interesting talk about XML::Pastor was seriously rushed. Pastor looks like a nifty way of mapping simply between perl classes and XML Schema. It's basically ORM for XML, which could be really useful for me, except that most of the XML I handle at work uses DTDs rather than schemata.

Then I had the misfortune to attend another talk given by Adrian Witas. This one was about ORM, specifically Persistence::Entity. Adrian again failed to give any indication of the benefits of this module over the alternatives. I considered escaping to Tim Bunce's profiling talk about Devel::NYTProf, but I'd already asked a question, and there were only about three other people in the room, so that didn't seem very polite. I should have had the courage of my convictions, as Tim's talk was voted one of the best in show.

Never mind, osfameron's talk on functional programming was another instance of Devel::Declare to the rescue, giving perl native-looking currying, monads, list comprehension and pattern matching (of function arguments to multiply defined subroutines, not of strings to regexen), or as osfameron put it, "combining general perl evil with the goodness of haskell". Like the Acme::Yorkshire talk, this illicited gasps, moans and laughter from the audience, and I for one can't wait for Acme::Monad to be released.

Then it was the lightning talks, which were all good, for a variety of reasons:

  • Action Aid presented a video showing how the money from the raffle would be spent.
  • Leo Lapworth presented his 20-minute "DBIx::Class for (advanced) beginners" talk in only five minutes, but still managed to make sense, and teach me something new.
  • Someone whose name I forget presented TAP::Formatter::HTML, built on top of TAP::Parser, which produces a fancy HTML page from the output of a perl test. This is a simple overview with drill-down capability, making it easy to save and interpret your test results.
  • David Leadbeater presented his work on Wikipedia summaries, which enable searching Wikipedia via a variety of interfaces. Of special interest was the DNS query method: host -t txt perl.wp.dg.cx
  • Edmund von der Burg showed his scarily short Sudoku solver (3 lines of less than 80 characters), and expounded on the virtues of perl golf: thinking about problems in a different way, and understanding exactly what every part of your code is doing.
  • Matt Trout loudly disputed the view which he thinks most people have; that they aren't good enough to contribute to the community. Everyone should write reuseable code and post it on CPAN. Failing that, submit patches to module authors. Failing that, submit tests, so they can at least see what the bug is, and know when they've fixed it. Or while you're still learning how to use a module, write up your experiences as documentation, since you know what problems you're facing, which the author has probably forgotten about.

Finally, the raffle. The winner of the iPod donated it to Mark Keating, who as organiser wasn't allowed to participate. Mark promptly auctioned it off to raise another GBP107.01 for Action Aid.

Just before heading off to the pub, Greg McCarroll handed over the reins of London.pm to Leon Brocard. The pub was reserved in its entirety for workshop attendees, and the food and drink was all paid for by sponsors of the event, though the room was a bit too packed for even distribution of comestibles. Nevertheless, this was a great opportunity to match faces to names, and I had some interesting conversation with Tim Bunce and Paul Makepeace.

Lyle and I left relatively early, in case of bad traffic. It took overly long to crawl out of London, and we were beset by roadworks and a patch of incredibly thick fog on the motorway. Even so, we got back to Bristol before midnight, which I hadn't expected at the start of the day.

All in all, a great day out. I'm looking forward to next year.

Change Colour