RC bug roundup

On Wednesday, I fixed #551228 in libgstreamer-perl - from the bug log, it looked like it would be an intriguing parallel-build problem, but I reckon it was just a faulty test. Next I applied a patch from the upstream bug tracker for #544894 in libtk-filedialog-perl, which was fine; but then we noticed that there was no explicit copyright notice in the source, so it hasn't been uploaded yet. The code is from 1996, so we would request removal from Debian if it weren't for 'horae' depending on it. Hmm... ...

November 14, 2009 · Tim Retout

Transaction Scope Guards

I've been writing some Perl DBI code which involves some fairly involved error handling; I've been looking for a way to roll back transactions neatly when certain errors happen. I very nearly reinvented the concept of a 'transaction scope guard' which I now find is implemented in DBIx::Class (with Scope::Guard implementing a more general version). A lexical variable can be used to detect in which cases a transaction should be ended, because the object it points to will get DESTROYed when it goes out of scope. Some rough code to illustrate the concept is below. ...

October 25, 2009 · Tim Retout

Code Reuse

At work, I have been refactoring old Perl code. Part of me feels that this was tangential to the main aims of the project I've been assigned, but another part of me can list all the bugs I've found/fixed and the advantages in terms of maintainability, so on balance I think it was a good idea. Something I like even more than tidying code is reducing the amount of code required. (I've been doing a lot of that as well.) Breaking code into reusable modules is the essence of what I'm trying to achieve - later projects within the company (and perhaps beyond) should not have to reinvent what I'm writing. I'm attempting to replace boilerplate code with existing modules from CPAN where I can - I'm fortunate in that this seems to be possible licensing-wise within our product. ...

October 4, 2009 · Tim Retout

Unit testing

I spent the last day and a half writing a vaguely interesting Perl module for testing some code which gives a subtly different answer each time (i.e. incorporates data from time() and /dev/urandom) and has side effects (i.e. writes to the file system). By overriding Perl's built-in 'open' function, it is possible to prefix each filename with the location of a temporary directory, effectively emulating chroot(). I also replaced Perl's time() with one that always returned the same answer. This meant that the login code I was testing would return a reliable result. ...

September 9, 2009 · Tim Retout

O RAILLY

I am not having a good year. Traditionally, when annoyed, I make extravagant purchases that I may or may not regret later. In this new economic climate, however, I have found a substitute outlet. Arriving soon at a CPAN mirror near you: Net::NationalRail::LiveDepartureBoards 0.01 - an interface to a SOAP API from ATOC. Given a station code, you can obtain the next few arrivals/departures/both. This is in hacky Perl, but the module should be easy to translate to other languages which have SOAP libraries.

January 8, 2009 · Tim Retout

That time of year again

I tend to update DateTime::Event::WarwickUniversity at around this time each year, according to the changelog. Version 0.05 will appear on CPAN with the next update. My testcases still pass, at least.

November 1, 2008 · Tim Retout

More CPAN uploads

Following my update on Monday, I've made changes to the build systems of both DateTime::Calendar::WarwickUniversity and DateTime::Event::WarwickUniversity, in my search for higher kwalitee. These are not important updates, they just add a few more tests, and so on.

November 22, 2007 · Tim Retout

DateTime::Event::WarwickUniversity version 0.02

Warwick University appear to have changed some of their future term dates, so I have released version 0.02 of DateTime::Event::WarwickUniversity to CPAN. This release also fixes bugs which were happening when using DateTime objects with time zones, so everyone should probably upgrade. Overall, I'm surprised that it took me a year before I had an excuse for a new release. It would be worth adding the ability to get a real date from a given term week, but I haven't quite needed it yet.

November 19, 2007 · Tim Retout