Tag Archives: perl

Perl Books

Those of you who have been following my work for some time might remember that many years ago I took some interest in Perl books. I don’t mean the kind of books that we all read (or, even write) with animals on the cover. I mean the kinds of terrible Perl books that at one stage seemed to take up over 90% of the space given over to Perl books in most bookshops. They had brightly coloured covers and made unlikely claims about how good you would be with Perl after an unfeasibly short period of time.

They all seemed to be written by people who didn’t actually know anything about Perl and they were full of the most atrocious Perl code that I’ve ever seen. Of course they were all not just about Perl but were about CGI programming with Perl (as that’s what everyone wanted to use Perl for ten years ago). It was easy to tell the quality of these books from the index. You just looked for mentions of “use strict”, “use warnings” or CGI.pm. Most books ignored them completely. At the time Schwern had a “litmus test” for the quality of Perl books. It was list of bullet points that you could use to easily calculate how bad a Perl book was. I seems to have dropped off the internet at some point in the last ten years.

Last weekend I was in the centre of London and I went into a couple of large book shops that I haven’t been to for some time. And it looks to me as though this problem has finally gone away. Looking at the Perl section in Foyles, for example, I saw a very few dodgy Perl books. Of course, there were far fewer Perl books of any quality than there would have been five or six years ago, but the ones that were left were pretty much all decent books.

My initial thought was that this was just another sign that Perl has lost the battle for the low-end web development market. People who want to hack up a web site no longer even consider using CGI programs written in Perl. These days those people would all use PHP. But it seemed to me that there weren’t many “Learn PHP in 24 Hours” books on the shelves either. So perhaps the low-end web development market doesn’t exist any more. Or, at least, perhaps it’s not big enough to make it profitable enough for publishers.

I’ll admit that my sample wasn’t particularly big. And Foyles isn’t exactly your average book shop. It caters for the higher end of the book-buying market. I wanted to test my hypothesis by looking at the computer books section in Borders over the road. But Borders has closed down. Another indication of the diminishing size of the book market.

I’m going to take this investigation further. I’ll check out the computer section in some lower-end book shops. But just to give myself some closure I’m going to declare my campaign against bad Perl books to be over. We won in the end. But it may be a slightly Pyrrhic victory.

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.

Net::Twitter and Iranian Elections

Over the last few days I’ve seen a large number of tweets saying that the Perl module Net::Twitter is being used to post pro-government propaganda from Iran. If it’s true, this is almost certainly a reaction to the large number of people who are using Twitter to get around the Iranian government’s censorship.

It’s disappointing, of course, to see Perl being used as an instrument of propaganda and repression. But that’s one of the dangers you have to face when you release software under an open source licence. I only hope that people realise that Perl is a tool that can be used by anyone and that we don’t run the risk of being linked to Ahmadinejad’s regime just because of the programming language we use.

iransource seems to be one of the pro-Ahmadinejad bots, but it’s been quiet for a couple of days. Has anyone been tracking these bots? And is there any previous evidence of Perl being using by repressive regimes?

Syntax Highlighting

One of the nice things about moving away from use.perl to your own site is that you can install whatever toys you want.

I’ll eventually get round to posting code on this blog. And when I do it would be nice if it had some nice syntax highlighting. I could, of course, write my own syntax higlighter (probably based on something like PPI:HTML) but that sounds far too much like hard work, so a couple of days ago I decided to poke around to see what prior art was out there.

Initially, it looked like I was in luck. In the Movable Type plugins directory I found a link to SyntaxHighlighter for Movable Type, which is an MT wrapper around SyntaxHighlighter 2.0. The example output looked rather nice.

I downloaded it and installed it. And then I prodded at it for an hour or so. But all to no avail. It didn’t seem to work as advertised (or, indeed, at all). I fixed one obvious bug in the Perl support but it didn’t seem to help. I hope that the problem is just that Perl support hasn’t had as much testing as other languages[1]. There’s no obvious route for support, so I’ve left a message for the author on his blog. Hopefully he’ll get back to me and we can get this ironed out.

But, all in all, it looks like I’m not going to be able to be as lazy I’d like to be.

Unless, dear readers, you know better. Do you know of a syntax highlighting plugin for Movable Type? Have you patched this one to work? Is there an alternative solution that I’m missing completely?

[1] Which is only to be expected as Perl is, as I’m sure you realise, a dead language :-)

Update: Thought I’d take a look at the Javascript to see if I stood any chance of debugging it. Look at this!

Updated update: People more on the ball than me have pointed out that a) the horrible-looking Javascript has been minified and b) the original code is on bitbucket.

A Perl Programming Blog

Here’s my new Perl programming blog. I have another blog where I talk about a number of different things, but I like to keep my Perl writing separate from the rest of it.. Until recently I kept a Perl journal over at use.perl, but the technology behind that site is looking pretty dated so I thought it was worth striking out on my own. So here I am at PerlHacks.com.

It might be interesting to explain how I came to own such a cool domain. It’s a story that has some useful lessons about the kinds of scams that people try to pull on the internet.

It managed to get perlhacks.org in 2005, just because no-one else had thought to buy it. But someone already had the .com and, even though they weren’t using it for anything, I suspected that they’d want a lot of money to part with it, so I didn’t even bother contacting them.

Then in September of last year I got an email from someone offering to sell me the domain. They contacted me as I owned the .org and they assumed that I’l like the .com to go with it. They wanted just under $1000 for it, so I ignored them. Over the following few weeks I got three or four more increasingly desperate emails from them. All of which I also ignored.

At the end of October I got a different mail. In this one they dropped the  asking price to $99. That was closer to the price that I wanted to pay, so I investigated further. I mentioned the mail on the london.pm IRC channel and someone pointed out that the domain had, in fact, lapsed and was available for anyone to buy.

There was a brief race as three members of the channel tried to register the domain at the same time, but it was a race that I won. I got the domain for less than £10. I took great pleasure in pointing out that fact to the people who were trying to sell it to me for $99. They never replied.

The lesson is, of course, to always check whether you can buy something cheaper than the price it’s offered at.

So there I was with both perlhack.org and perlhacks.com. And now they both point to me Perl blog.

Now I just need to think of something to write about.