Tag Archives: perl

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.