Hanging on to Perl

 by Martin Belam, 26 July 2008

James Cridland, BBC radio new media über-lord left a comment on here recently, pointing out that, despite the fact that I was watching the telly at the time, I was one of the very, very few people to put their hand up and admit to coding in Perl during the recent TechCrunch UK / BBC debate at Broadcasting House.

Streaming Euro2008 within Broadcasting House

The question arose because of the continual clamour that the BBC should release all production code under some sort of Open Source / Creative Commons / GNU GPL licence. James was making the point that there may not be such a pent-up demand once the Wizard's curtain was removed to reveal a whole bundle of Perl.

The reason that I ended up learning a smattering of Perl was precisely because I was at the BBC. It was Perl that the development infrastructure supported, and it seemed 'the thing to do'. I continue to use it because, rather like the failed Compact Cassette vs DAT or DCC transition I mentioned earlier this week - Perl is mostly still good enough.

All I ever really need to do programatically these days is fetch a web page and see if there are certain links in it, or fetch a web page and extract a specific region from it, or grab an RSS feed and slightly alter the contents in some way. These are all things that Perl is great for, as they basically boil down, one way or another, to manipulating a few bits of text.

Perl cheat sheet

I suspect that at some point down the line I might benefit from learning a bit of PHP or Python or Ruby or something, but seeing as I am not myself in the business of building scalable dynamic web applications - I just help to design them - at the moment I do just fine. In fact one of the last and most useful pieces of advice given to me by my line manager when I left the BBC in 2005 was "don't dabble in code".

The thing with Perl is that nearly everything about it, from the syntax to the default variables, is all based around being as lazy as possible. So, with that philosophy in mind, why would I buy reference books for a new language, and try and learn anything else? That just sounds like hard work.

In fact, now I come to think of it, if I could find a way to still use ZX Spectrum BASIC, and a rubber keypad with all of the possible commands you could use already printed on it, I would...

ZX Spectrum

2 Comments

Good points. Just because it's old(-ish) doesn't mean it's bad. Perl's usefulness stems right from the two facts that it's been around for a while (hence a huge library of reusable modules) and the core syntax is immensely flexible - leading to chaotic code in the wrong hands, sure, but also ensuring it can compete and be relevant today.

No-one should be apologetic about using Perl when it's the right tool for the job.

I still use PERL to. Takes me back to my uni days when I needed to code something quick or if I didn't have time to learn a new language but PERL would get me the same result. It is still useful and always will be, its longevity is a testament to its usefulness and has nothing to be ashamed of!

Keep up to date on my new blog