All posts by Dave Cross

About Dave Cross

Dave Cross runs Magnum Solutions Ltd., a London Perl consultancy. In 1998 he started London Perl Mongers, the first Perl Mongers group outside of Northern America.

Two Books

I’ve recently received review copies of a couple of new books. Here are the reviews of those books that I have submitted to Amazon.

Designing the Internet of Things – Adrian McEwen & Hakim Cassimally (Wiley)

I’ve been hearing people talking about “the internet of things” for a few years now. And I’ve always meant to find out what they meant by the term. Well now, thanks to this book, I have a really good idea. I might even think about building something for the internet of things myself (you know, in my copious free time!)

Adrian and Hakim obviously know what they are talking about. They both have experience of working on these kinds of projects. And, crucially, they also have the writing skills to pass their expertise on to the reader.

Some of the stuff in the earlier chapters, I already knew. But things like an introduction to TCP/IP and networking will be useful to many people who don’t have such a technical background. Software, I can do – it was the chapters about hardware that I found most useful. I now know far more than I did about the different toolkits that are available for building internet-connected devices.

Part I is about prototyping your device and part 2 is about building it. I’m sure that other books cover these topics – although, perhaps, not in the focussed way that this book does. But it’s part 3 where this book really shines. These three chapters cover business models, scaling your manufacturing process and some of the ethical issues that these devices raise. This section really makes the book a “one-stop shop” for finding all the information you’ll need to take your vague idea to a complete product and (hopefully) a profitable company.

Perl One-Liners – Peteris Krumins (No Starch)

Perl one-liners are an important part of its power and flexibility. The ability to process a file quickly without having to write a program is often really useful. Any Perl programmers should take the time to get to know the command like switches that make this possible. This book is a pretty good introduction to this way of using Perl.

So why only three stars? Well, I have a couple of reservations about the book. Firstly, there are a few technical errors which the editors should have caught. For example, a few times the author refers to “array context” where he means “list context”. The difference between arrays and lists is often difficult for beginners to master and it doesn’t help when books blur the distinction.

My other reservation is with the programs themselves. The book boasts “130 programs that get things done”. But I think they have had to stretch things a bit to get to that number. One program might be “print lines that match a pattern”. Then the next program will be “print lines that don’t match a pattern”. I’m not sure that inverting the logic in a one-liner is enough of a difference to justify counting it separately. Sometimes you’ll come across two or three pages of examples all of which are only tiny permutations of each other.

But it’s good to see publishers bringing out books on Perl. And this is certainly an area of Perl that hasn’t received much coverage before. I just think it’s a rather thin concept to spin out to a book. Even this stretched, it’s a rather thin book (140 pages – 50 of which are appendices). It might have been better as a cheap Kindle-only publication.

Perl in Banks

An email has flooded in:

I came across your presentation ‘Perl in the Enterprise’ and happen to have a burning concern closely related to one of the bullets ‘Banks see <Perl> as a competitive advantage’.

I am consulting at a major bank in South Africa, and our team have been using Perl very productively to develop and maintain a customer loyalty rewards  application. This application has now suddenly caught the attention of the ‘Architecture Board’ who are questioning whether Perl (or any other scripting language) is appropriate for production use. A presentation will have to be made to this board to present a business case.

Whatever the basis for this concern, some quotable and referencable stories from other banks, such as the list included in your clients on the website, would be gold for us. I have searched extensively on the web and cannot find anything in this light which is also recent, as in the last 5 years. Other than Nvidia and Booking.com I can only find anecdotal, 2nd hand evidence of Perl use for medium-to-large applications in well-known corporates.

Do you by any chance have anything or any contacts in those banks that would be willing to respond to an email to confirm their use of Perl and perhaps repeat the competitive advantage claim?

The presentation he’s talking about is Perl in the Enterprise, which I gave at Linux World Expo in 2005. The particular line he’s interested in is on slide 6 where I say that banks see using Perl as a competitive advantage. I’m pretty sure that I was paraphrasing Phillip Moore of Morgan Stanley who had said something similar in a keynote at OSCON in about 2001.

Obviously I know that banks in the City of London still use Perl. But it’s been several years since I worked at one, so my personal experience is slightly out of date. What my correspondent needs is people who are currently working in banks who are happy to go public and say “we use Perl in our production systems”. It would be even more helpful if they could add “and here’s why…”.

Can anyone out there help?

Perl Search Revisited

A couple of years ago I wrote a blog post about a Google Custom Search that I had set up to create a specialised search engine for Perl.

Recently I’ve revisited this idea. I’ve given the search engine its own subdomain and I’ve added some new sites to the list of sites that it covers. I’ve also given it a simplified look (thanks Bootstrap) and it’s now being hosted on Github pages.

It lives at http://search.perlhacks.com/. Please give it a try and let me know what you think.

Talks from Kiev

It has only been a few weeks since YAPC::Europe in Kiev and already all of the videos are available on YouTube. Here are the recordings of my three talks.

On the first day I spoke about “25 Years of Perl”.

Later that day I was one of the lightning talk speakers. My talk starts at about 52 minutes.

Then on the second day I spoke about “Matt’s PSGI Archive”.

Parallel Universe Perl 6

Last night was the monthly London Perl Mongers social meeting. I hadn’t been for far too long, but I went last night and enjoyed myself.

The talk was as varied as it always is, but one conversation in particular got me thinking. We were talking about YAPC Europe and someone asked if I had seen the Future Perl Versioning Panel. I said I had and that I was slightly disappointed with the make-up of the panel. In my opinion having three people on the panel who were all strong advocates for Perl 6 remaining Perl 6 didn’t really lead to much of a discussion.

In the end, though, any discussion on this subject is pretty pointless. Larry’s word is law and he has made it very clear that he wants things to remain the way they are. And, of course, any discussion of what might have happened differently if Perl 6 had been given a different name or any of the other alternatives is all completely hypothetical.

But hypothetical discussions can be fun.

So lets turn the discussion round and look at it from a slightly different angle.

Imagine you’re in an alternative universe. One where Jon Orwant never threw those coffee cups and the Perl 6 project was never announced. But also imagine that Perl 5 development in this universe had proceeded along the same lines as it has in our universe (I know that’s unlikely as a lot of Perl 5 development in the last ten years has come out of people wanting to implement ideas from Perl 6 – but let’s ignore that inconvenient fact).

My question to you, then is this…

In this parallel universe, at which point in the last thirteen years of Perl 5 development should we have changed the major version number to 6?

I have an answer to the question, but I’d like to hear some other opinions before sharing it.

CPAN RPMs

If you’ve been reading my blog for a while, you’ll know that I have an interest in packaging CPAN modules as RPMs for Linux distributions based on Red Hat.

For a few years, I’ve been (infrequently) building spreadsheets which list the various modules that are available as RPMs from the better know repositories (and my own small repository). Over the weekend, I thought that those spreadsheets might be more useful if they were turned into web pages. So that’s what I did.

You can see the lists for Fedora and Centos. Over the next few days, I plan to set up cron jobs so that they are rebuilt daily.

Please let me know if you find these lists useful.

Unicode and Perl

Over the last couple of days I’ve been involved in a couple of discussions where it is clear that other people don’t understand how Perl deals with Unicode. The documentation is clear and detailed (there’s even a good tutorial) but for some reason people still persist in misunderstanding it.

Here’s a quick quiz. Can you explain (in detail) what is going on with all of these four command-line programs? And for bonus points, which one should we be emulating in our code?

$ perl -E'say "£"'
£
$ perl -Mutf8 -E'say "£"'
�
$ perl -C -E'say "£"'
£
$ perl -C -Mutf8 -E'say "£"'
£

In all cases, assume that my locale is set to en_US.UTF-8.

I’ll post explanations in a few days time.

Update: Coincidentally, Miyagawa posted something very similar on his blog.

A WordPress Critter

Perl News - Powered by WordPress
Perl News – Powered by WordPress

If you were at YAPC::Europe this week you might well have seen Richard Jelinek’s talk about how to increase Perl’s popularity (update: the slides are here). As part of that talk he suggested that the Perl community needed to run more of its infrastructure using Perl and (amongst other examples) he mentioned a discussion he had with an unnamed Perl News administrator about why Perl News is run using WordPress (which is written in PHP).

I’m happy to admit that I’m the unnamed Perl News administrator. But I think that Richard’s report of our conversation omits a lot of the detail in the points I tried to make to him. So I’d like to take the time to clarify my thoughts on this. There are three points in particular that I’d like to make.

1/ Multitasking

I have a lot of projects on the go. I should probably cut back a bit. Yes, I could start a project to create a WordPress clone in Perl, but that would mean that I would need to shelve a few other projects for some considerable time. The alternative is to quickly build Perl News using an existing tool. You know which option I chose. Of course, you’re free to disagree with me.

2/ Network Effects

Even if there was a capable WordPress replacement written in Perl I probably wouldn’t use it. You see, WordPress isn’t just the software. There’s also a huge community behind it. And that means that there are a huge number of themes and plugins available – with more being released all the time. Every time I want to add a feature to WordPress site, I just find the appropriate plugin and install it. Without that huge community, I would have to implement lots of stuff myself. Which would mean that either I’d be working on Perl News full-time or Perl News would be missing lots of features (for example the social networking hooks).

Don’t forget that I’m also involved in running blogs.perl.org. That runs on Movable Type (which is written in Perl). And have you seen the list of issues that we have with that site?

3/ Patches Welcome

Leo and I built Perl News because we thought it was a useful site for the Perl community to have. You can probably tell from the frequency of updates on the site that it’s not exactly a top priority for either of us. Personally, I’d be very happy if someone else took responsibility for it. So if you think that you can do better, or if you have a Perl system that you think could be used in place of WordPress without any removal of functionality, them please let us know. I’d be really happy to give you a dump of our database (so that you have all the existing stories) and update the DNS to point the domain at your server.

If it matters to you to have Perl web sites running on Perl code, then just go ahead and do it. I would be happy to see it happen. I just don’t have the time to do it myself.

YAPC Europe Approaches

This time next week YAPC Europe will have started and many of us will be enjoying ourselves in Kiev. The organisers published the schedule over the weekend and it looks like it’s going to be a great conference.

I spent some time trying to work out which talks I want to see and I’ve written some suggestions in an article over at Josetteorama. Let me know if I’ve missed something that you’re planning to see.

Just Build Something

The Political Web

About a month ago, JT Smith suggested that we should all stop talking about Perl and just build something. And, purely coincidentally, over the last few weeks I resurrected a project that I have been poking at for about five years and have finally turned it into something that I’m happy to show the world.

The Political Web is a site which aggregates all of the information I can find on the web about individual British MPs. I say “all of the information”, but that’s obviously a bit of a work in progress. But I think that what I already have is useful and interesting – well, for people who are interested in British politics. I have plans to bring in more information in the future.

Although I’ve been working on the site for five years, I pretty much rebuilt it from scratch when I recently returned to it. Actually getting something useful up and running took about four hours. That’s because I was building it using Perl and, more specifically, Dancer.