Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

davorg (18)

Yahoo! ID: daveorguk (Add User, Send Message)

Hacker, author, trainer

Technorati Profile []

Journal of davorg (18)

Monday May 18, 2009
03:07 PM

I'm Off

For pretty much the same reasons that you've heard from many other people, I've decided to take my Perl blogging elsewhere.

You'll find me over at Perl Hacks.

Friday May 01, 2009
05:58 AM

YAPC::Europe Talk Proposals

The CFP for this year's YAPC::Europe closed yesterday. Usually this means I have a frantic couple of hours rushing around proposing (semi-)random talks. This year I've been a bit more organised and have been proposing talks as they have occured to me. The upside of this is that I have confidence that they will all be interesting talks. The downside is that I've proposed more talks than ever before. I hope the organisers don't select all of them (I'd like to see some of the conference) but I've given them lots of choice :-)

There are a couple of talks based on the conference's theme of "Corporate Perl".

  • Why Corporates Hate Perl
    This will be loosely based on my blog post from lst year - but I've got lots of other things to add based on the feedback I received. This is, at least partly, a sequel to Programming Languages and Perl and Proud to Use Perl.
  • Why do so many companies re-invent well-known CPAN modules badly and end up writing far too much code?
    I was going to give this talk at a recent technical meeting, but was ill and was unable to present it. The title pretty much describes what I'll cover.

There's a talk following up on something I spoke about last year in Copenhagen.

  • Perl in RPM-Land (The Return)
    Last year I talked about building RPMs of CPAN modules and suggested that we could do this automatically for a large percentage of modules. This is conference-driven development. If this talk is chosen then I'll have to make a start on the project.

And there's a talk about a project that I'm currently pretty enthused about.

  • The Planetarium
    This is about using Perl to aggregate web feeds. In particular I'm trying to build sites that are useful tools for building local communities. It's not really on-topic for the conference, but I think it's interesting.

So now it's just a case of seeing which ones the conference organisers choose. Does anyone know when that will be announced?

Update: They chose Why do so many companies re-invent well-known CPAN modules badly and end up writing far too much code? and The Planetarium.

I'll see you in Lisbon.

Tuesday March 31, 2009
03:02 AM

Task::Kensho RPMs

One of the first concrete outputs from the Enlightened Perl Organisation has been Task::Kensho - a CPAN module which exists to list a number of other CPAN modules that modern Perl programmers should consider using. if you install Task::Kensho then all of the included modules will automatically be pulled down from CPAN and installed.

I don't install my modules from CPAN. As I live in the Red Hat world, I like to install RPMs of modules. And I build RPMs for modules that aren't already available in that format (and then I make them available to everyone).

So last night I created an RPM for Task::Kensho. This also involved building RPMs for about half of the modules it include which didn't already exist as RPMs in the standard repostories. Those RPMs are now available from my repository so installing them all could be as simple as sudo yum install perl-Task-Kensho. Of course, you can also install individual packages using the appropriate yum command.

Currently the RPMs are only available for Fedora 10. I'll build versions for Centos 5 over the next couple of days.

Wednesday February 25, 2009
04:56 PM

MySQL Stupidity

Been a while since I reported on MySQL's stupidity, but I came across a fine new example yesterday.

Create a table with a varchar column.

create table foo (foo varchar(10));

Insert a data value which is two numbers separated by a pipe character (don't ask, just accept that this was the data format I found in my table).

insert into foo values ('111|1');

Now let's try to select some data.

mysql> select * from foo where foo = '111|1';
| foo   |
| 111|1 |
1 row in set (0.00 sec)

Ok. That makes sense. That's expected behaviour.

mysql> select * from foo where foo = '111';
Empty set (0.00 sec)

That also makes sense, of course. The string isn't '111', so it doesn't match.

mysql> select * from foo where foo = 111;
| foo   |
| 111|1 |
1 row in set (0.00 sec)

Huh! I mean "What!?!".

There are at least two fundamentally stupid things going on here.

Firstly, MySQL is allowing me to match a string column against a number. When a user tries to match a value of one type against a column of another type, the only sensible action is to throw an error. The user is trying to do something completely wrong. Tell them that. Don't try and work something out.

Secondly, if you insist on trying to convert datatypes in order to force a match, then convert the user's data into the database column's datatype, not the other way round. The database column is a string. Convert the number to a string and try to match that string against the database (that would have returned no data). Instead MySQL is trying to convert the database value into a number to match the user's input. It looks like it's using something like Perl's string to number conversion so the string "111|1" is converted to the number 111 and therefore matches the user's input.

So you can actually get MySQL to match data which doesn't match at all. I wasted two hours on this yesterday.

I found this yesterday on a MySQL 4.x server. I've just tried it on a 5.0.67 server and the same bug is still there.

Oh, and setting the SQL mode to "traditional" doesn't seem to fix it either.

Wednesday February 18, 2009
08:23 AM

Yak Shaving

For a few months I've been playing with conky - which is a nice system for writing stuff onto a Linux desktop. I was introduced to it by a series of LifeHacker posts last year.

Just last week, they featured a really nice set-up which I wanted to go some way to recreated. The post included a link to the programs that were used to create the desktop, so it was easy to work out what was going on.

Most of the data was pulled from web feeds and converted to flat text. That's a nice approach as once you've got that working, there's no limit to the data you can use.

I was slightly disappointed, however, to see that the code included in the article had three separate scripts (one for each source used) and that they were all bash scripts which used curl to grab the feeds and load of sed and grep to extract the relevant parts. What this really needed was a generic approach.

So I reached for the Template Toolkit. And I reached for Template::Plugin::XML::RSS. And then I stopped myself. Not all web feeds are RSS these days (that's why we've largely stopped calling them RSS feeds) so XML::RSS wouldn't always be the right tool. What I really needed was XML::Feed - which handles both RSS and Atom and treats them both in the same way.

But there wasn't a Template::Plugin::XML::Feed. I say "wasn't" rather than "isn't" as there is one now - I uploaded it last night.

I didn't get much time to play with conky. But I've now got all of the tools I need. In particular, I can create simple programs like this to access web feeds.


use strict;
use warnings;

use Template;
use URI;

my $t = Template->new;
my $uri = URI->new('');
$t->process(\*DATA , { uri => $uri })
  or die $t->error;

[% USE tweets = XML.Feed(uri);
   USE autoformat(right => 80);
   FOREACH tweet IN tweets.entries -%]
[% %]:
[% tweet.title | autoformat -%]
[% LAST IF loop.count == 5 -%]
[% END -%]

Of course, I need to remove the hard-coded URI and put the template into a separate file. That's tonight's first little project.

Wednesday December 24, 2008
04:57 AM

Releasing Press Releases to the Press

The Perl Foundation Migrates the Perl 5 Development Repository to the Git Version Control System

That's not news, of course. You all read that story on the front page of use.perl a couple of days ago.

What's new (I think) is where you can find the press release. It's on PRWeb. For those who don't know, PRWeb is the best-known press release distribution service. The TPF Git press release will now be arriving in the inbox of hundreds of editors and other interested parties who have subscribed to technology news. And that, of course, increases the chance that the story will be published in the tech press and that people outside of the echo chamber will read it.

When the Git news broke a couple of days ago, we were discussing it the IRC channel. acme had published the press release in the usual Perl news channels, but someone suggested that as we had a press release, it would be nice to get it out through the standard press release channels.

It turned out that Dave Hodgkinson had a) a PRWeb login, b) half an hour to spare to register the press release and c) the $80 it costs to use the service.

I have no idea how successful this will be, but it seems to me that if the Perl community has interesting news like this, then it's worth spending the occasional $80 to get that news out on the wires.

It's got to be worth a try. Thanks to Dave for his efforts.

Update: Over on ZDNet, Joe Brockmeier adds his thoughts to the discussion.

Wednesday December 17, 2008
11:40 AM

Perl Training in London

In conjunction with the UKUUG and O'Reilly, I'm running two days of Perl training in London in February.

The first day (the 25th) is a beginners' course and the second day (the 26th) is a lot more advanced.

Full details (including a sign-up form) are on the UKUUG web site.

Hope to see some of you there.

Wednesday October 29, 2008
12:41 PM

A few years ago I tried to register the domain It wasn't available at the time so I registered the domain instead. As so often happens, I didn't have time for the project I planned to use it for so it did nothing useful until I made it a redirection to the O'Reilly catalogue page for Perl Hacks. At that point I largely forgot about the domain.

A couple of weeks ago I got an email from someone telling me that was for sale. This was a domain reseller and they were targeting me because I already owned the .org. They were asking for $997 (but the web page also said 'make us an offer'). They must have been pretty desperate as over the next week or so I got three or four more emails from the same people. They never dropped their price though.

Today I got another mail from them. And this time when I visited the site the price had dropped to $99. I mentioned this in passing on the IRC channel and someone else pointed out that actually the domain had lapsed and was available for anyone to buy. In which case, $99 was far more than you'd expect to pay.

I checked with my usual domain register and found that the domain was, indeed, available. So I ordered it. Actually three of us ordered it at about the same time and my registry obviously had the fastest systems in place as I got the registration. For less than £10. I then took great pleasure in replying to the people who were trying to sell me the domain telling them what I'd done. I didn't get a reply.

But now I have both and And I still don't really have a plan for what I'm going to do with them.

Does anyone have any ideas?

Thursday October 16, 2008
03:58 AM

Perl Blogs

At YAPC::Europe this year I gave a talk called Proud to Use Perl where I talked about some of the achievements of the Perl community and suggested that we should shout about these achievements a little more than we do.

And as an example of this shouting, I set up a new Proud to Use Perl web site where I was going to write about all of the amazing things that Perl has to be proud of.

Which I did for about a week.

It's always the same. I go to a Perl conference, get too enthused about stuff and end up volunteering to get involved in too many projects and having to spread myself too thin.

So the Proud to Use Perl site effectively died.

But even though I don't have the time to put into it, I still think it's a good idea. And I wondered if anyone else would be interested in getting involved.

So I'm looking for a few people who would like to write for the site. It would be great if we could get new an interesting things published on the site every couple of days. Surely there's no shortage of things for the Perl community to be proud of. It might be a good place, for example, to share success stories.

Anyone interested in getting involved? Leave a comment here or drop me an email.

And that's not the only Perl web site project I've been neglecting. Earlier this year, I registered the domain The idea with that was that I'd set up a blog talking about Perl culture (in some vague, undefined way). But that site was abandoned even sooner. I didn't even get as far as installing Movable Type.

So I'm interested in getting a few authors to help me out there too. Maybe a few Perl Monger group leaders could write things there? Or people involved in organising YAPCs. Or people involved in other parts of the culture - Perl Monks, perhaps, or Perl Golf.

I'll get MT installed on the server this evening. Same thing applies, if you're interested then leave a comment or drop me an email.

More Perl blogs has got to be good, right?

Thursday October 09, 2008
03:52 AM

Perl on Upcoming

I've banged on before about how Perl is seen as less popular than it really is because the Perl community can be a bit insular. I believe that we need to get out there and tell people that a) we're still here and b) we're still wonderful.

As an example of that, we've started to ensure that all of's events are listed on Upcoming and we encourage people to register their attendance so that we can demonstrate how popular our meetings are. Recently, I also created a group to make it easier to track down our events. When adding events to our group, I also add them to a couple of other local geeky groups - which gives us a bit of free publicity. Maybe other local groups could consider doing the same (I see that some already do).

Today I also created a global Perl group with the intention of collecting all worldwide Perl events. If you create any kind of Perl-related event on Upcoming then please add it to the group.