Monthly Archives: September 2009

Building Web Sites with Perl

Over on my other blog last night I wrote a piece about how building simple web sites has never been easier. I talked about how it’s really simple to use something like WordPress or Drupal to build a web site that will suit the needs of many organisations – charities, schools, organisations like that.

You’ll have noticed that both Drupal and WordPress are written in PHP. If I was going to include another item on the list, it would probably be Joomla – which is also written in PHP. The first Perl-based system on my list would be Movable Type (or perhaps Melody, the community-driven fork of MT).

I use MT to build blogs (this site is built with MT). I also used it to build my company web site. So why isn’t in my top three suggestions? Well for two reasons. Firstly I don’t think that it’s quite as easy to use for non-technical people as the other systems on my list. And secondly, last year I tried to use MT to build something more complex than a single-blog site and it all went horribly wrong. With some help from the people at Six Apart those problems are getting sorted out and hopefully the project will be launched soon, but I’m currently wary of recommending MT to end users wanting to build sites.

Of course MT gets better all the time. The MT5 betas look really nice and I’m really hopeful that Melody will be a great end-user CMS. But currently I’d still recommend Drupal and/or WordPress.

End users don’t care at all what technologies their web sites are built in. As long as the site looks good and works well, why should it matter to them whether the site is written in PHP, Perl or anything else? But from the point of view of language advocacy, I’d like to be able to recommend something that’s written in Perl.

So what can we do? Well, firstly, you can tell me if I’m missing anything. Is there some other Perl-based simple web site builder that has completely passed me by? What systems would you recommend (or use yourselves) if, for example, a local school asked for help building a simple site?

And if there isn’t something that I’ve missed? Should a group of us sign up for the Melody project in order to ensure that it becomes a worthy alternative to Drupal? Is there some other project that we can co-opt to this purpose?

Or do we just not care? Is it ok that we’re in danger of losing the low-end web CMS market to PHP systems?

Speaking and Training and Stuff

I spent some time over the weekend adding events to the london.pm group on Facebook. If you’re on face book, then joining the group is a good way to keep up to date with what london.pm is doing. But for the three of you who aren’t on Facebook, here’s a summary of what I added.

There’s a technical meeting this coming Thursday. More details (and sign-up) on the web page. It’s being held in a pub on Queensway.

Then on October 8th there is the monthly london.pm social meeting. This will be in The Gunmakers in Clerkenwell. I believe that a breakaway sect of London Perl Mongers will be holding a heretical meeting on October 1st, but you’d need to ask them for details of the venue.

But the big news is the announcement of the date of this year’s London Perl Workshop. It will be on December 5th at the usual venue (the University of Westminster’s Cavendish Road building). The organisers are already taking talk submissions, so if you want to share your knowledge with a large number of Perl hackers (we usually get a couple of hundred people there) then please sign up and submit a proposal.

And a couple of plugs for non-london.pm events. On October 15th, miltonkeynes.pm will be having a technical meeting and I’ll be speaking there. Somehow I got talked into giving two presentations so I’ll be speaking on “Teaching Perl – Experiences,
Anecdotes and Vague Conclusions” and “How I maintain
my CPAN modules”.

Finally, I’m running three days of Perl training at the Imperial Hotel in Russell Square, London in November. The three days are completely separate courses, but they are arranged so that you can come to all three – although going from complete beginner to the advanced course in three days might be a bit of a stretch. The three courses are:

  • 24th Nov – Beginners Perl
  • 25th Nov – Intermediate Perl
  • 26th Nov – Advanced Perl

Full details are on my training page and to keep up to date with my forthcoming speaking and training dates you can subscribe to my calendar or join the mailing list.

The Definitive Guide to Catalyst

I’ve just published my review of “The Definitive Guide to Catalyst“. I thought it was worth quoting the final paragraph here:

The application development methods discussed by the authors of this book are the ones which will define good Perl development practice in the coming years. If you have any interest in how you should be developing Perl applications then you should be buying this book.

In short, I think you should all buy it.

Greenwich Mean Time

Some of you might already know that I run the nms project. We supply drop in replacements for the CGI programs from Matt’s Script Archive in an attempt to raise the average quality of Perl on the web.

Having my email address associated with a project like that brings me some… er… interesting mail. Here’s an example from this morning. I got an email that contained no text. All of the content was in the subject, which read:

However the GMT “website” which you seem to be connected with is a DISGRACE

This looks like a pretty common type of mail that my nms address gets. Generally it’s from someone who has had trouble using a site which uses the nms formmail program. The default error page contains a link to the nms site, so people who see the error page for whatever reason often follow the link and end up on our site. Once there they leap to the conclusion that we are somehow connected to the broken site and sent me a snotty mail. I generally reply asking for more details of the site they are using (it’s amazing the number of people who just say “your site is broken” without mentioning which site they are talking about) so that I can put them in touch with the correct people. So I replied to this gentleman asking which site he was talking about.

He replied quickly. This time his message did include some text:

Dear Dave,

The “GMT website is easy to find with any browser. My difficulty is that this website is devoted to THE British time standard. In view of this fact, I have serious reservations regarding its use of US server time etc…..On this matter it is nothing to do with being anti-American or anything of this sort. It is simply the case that GMT is a BRITISH standard and no one else’s.

Look forward to hearing from you in connection with this issue.

Notice that he hasn’t answered my question. This is also more common that you might suspect. It took another round of replies before I found out that he meant wwp.greenwichmeantime.com.

Looking at their feedback page, I see that they are using nms formmail, so that’s how he got in touch with me. But try as I might, I can’t work out why the site is a DISGRACE. I’m not sure what he means by “its use of US server time etc…”. According to MaxMind, the server is actually in Germany.

I’ve asked him for more clarification. I know I shouldn’t. It’ll only lead to more incomprehensible madness. But it’s like picking at a scab – once I start, I can’t stop.

I’ll let you know how it goes.

Perl Twitter Feed

Last August, when I was writing my talk Proud to Use Perl for YAPC::Europe, I wanted to get a feel for what real people were actually saying about Perl. It’s all very well claiming that people say Perl is dead, but I wanted to get some real quotations to use in the talk. I came up with the idea of using Twitter. I set up a Twitter search feed for tweets containing the word “perl” and monitored that for a couple of days. I quickly got all of the quotations that I needed.

But I found the feed fascinating, so I continued to read it. Sometimes the Perl community can be a little insular, so it was interesting to read what other people were saying about Perl. I still read the feed today.

Over the year, the feed definitely feels like it’s getting bigger. I mean, there are more mentions of Perl. I don’t have any concreate figures because I read the feed at random times of the day and sometimes don’t touch it for a couple of days. It’s tempting to think that more talk about Perl is due to things like the Ironman initiative, but we shouldn’t jump to that conclusion. Firstly, more talk about Perl could just mean more people saying that Perl is dead (I don’t think this is the case) but secondly more talk about Perl could just be indicative of more talk on Twitter in general. Certainly the number of users on Twitter is still grwoing quickly, so that could probably explain the growth in Perl talk.

But over the last week or so, I’ve gradually realised that a lot of the increase in tweets mentioning Perl is due to the increase in spam (or, at least, spam-like) tweets mentioning Perl. I see a huge number of posts from accounts like @e_host which do nothing but advertise web hosting companies. I suppose we should take it as a positive sign that they think Perl is a feature worth mentioning in these adverts. There’s also been an increase it tweets that are reposts from hire-a-freelancer sites. For example, this morning I saw dozens of copies of this “Need Perl Expert” post.

I’m seriously considering dropping the Perl Twitter feed from Google Reader. It’s just becoming such a slog to go through it. I estimate that about a third of it it currently interesting – and that signal to noise ratio is only going to fall.

I do think, however, that it would be useful and interesting (and pretty easy) to set up an application which monitors the feed and records the data. If we just counted the number of posts, that would be interesting. We could even consider pushing the text through some kind of analysis to pull broad types of information from it (“is this a positive or negative mention of Perl?”). The sooner we start, the more data we’ll have to play with.

I think I’ll set something up tomorrow.

Moose or No Moose

I’ve known about Moose for some time.The first time I talked about it in a training course was at the Teach-In back in the summer of 2007. It’s been part of my training courses ever since.

But even though I was telling people about Moose in my training courses, I wasn’t really making use of it in my own code. Obviously as a freelancer, in my day-job I’m constrained to using whatever technologies my clients are using and I have yet to be paid to work on a project that is already using Moose (although I’ve suggested that a few clients switch to it).

That leaves my own code. Which is largely my CPAN modules. Until recently I hadn’t used Moose for any of them. The first one I released that used Moose was Guardian::OpenPlatform::API. That was a new module which used Moose right from the start. But I knew that eventually I’d want to go back and refactor my existing modules to use Moose wherever it was appropriate.

Having gone to YAPC::Europe this year, I was subjected to another week of people telling me face to face just how cool Moose was. So I decided that it was time to bite the bullet and start refactoring.

The next module I tried was Parse::RPM::Spec. I chose this for two reasons. Firstly, it’s very much an attribute-driven module. Apart from the initial parsing of the spec file, objects of this class exist simply to return the values of their attributes. This makes it a great match for Moose. In fact converting it to use Moose was largely a case of removing code. The second reason for choosing it was more pragmatic – as far as I know no-one is using the module so if I broke anything I wouldn’t have hordes of angry users on my back.

Impressed by how easily that conversion was I moved on to Array::Compare. This module holds a special place in my heart as it was my very first CPAN module. I don’t think it’s a particularly useful module. It’s algorithm is pretty basic and other than the project that I originally wrote it for I’ve never used it in any production code. I often use it to try out new techniques. I released version 2.00 on August 9th (the change of implementation seemed to justify bumping the major version number).

Yesterday I got an RT ticket asking me to stop using Moose. The ticket is pretty clear that for several uses (it specifically mentions command line usage) the extra overhead added by Moose leads to an unacceptable performance hit.

I’m not sure which way to go on this. As a developer I like using Moose. Moose makes it much easier to write object oriented code in Perl. And I think that over the next year or so more and more CPAN developers will be using Moose in their code. Already if you’re writing something reasonably complex in Perl there’s a good chance that you’ll be using a module that uses Moose. As time goes on the percentage of Perl code that relies on Moose will increase. But if it really imposes an unacceptable performance hit for smaller applications, do I really want to force developers into using Moose sooner than they want to?

I think I’m going to put on hold my plans to move stuff to Moose until I’ve thought this through a bit more. But I’d be interested in hearing other people’s opinions. If you’re a CPAN author, are you planning to move your modules to Moose. And if you’re an application developer, have you started to avoid CPAN modules which force you to use Moose?

Let me know what you think.

Update: Well, didn’t this entry start a lot of discussion? As well as the comments here, there have been a number of other posts that reference my post. Here are the ones I’ve seen (in no particular order):

I’ll add more as I come across them. Of course, the more discussion I see, the more unclear my decision becomes.

But thanks for the interest. The discussion has been fascinating.