Perl

Perl5-to-6 sessions

Topics

Perlgeek.de has some articles on the transition from Perl5 to Perl6, while clearly explaining the differences between those versions. Very interesting, not only for a Perl6 introduction, but the articles also learnt me some new Perl tricks I didn't master yet.

Speaking of Perl, it keeps amazing me what someone can do with this language. In our new TSM version, IBM changed the web frontend to a full blown Websphere application, called ISC, with of course its own user database, different from the one in TSM, and kept in an unaccessible format. That's a big problem in an organisation which has about 150 TSM operators. We almost feared that this would end up in a manual definition of those people. It was there that I grabbed the documentation from WWW::Mechanize, which I discovered during my Test::More enlightenment. Within two hours, I had hacked up a Perl script which pulled all info about the operators from TSM, and entered them automagically in ISC.

Love this stuff !

Automated testing in Perl

Topics

Testing ! Is there anything sexier than program testing ? Apart from 3D gaming development, cloud computing, automated Kickstart installation, high-performance clustering, Rails development, etc ? Okay, testing is even more boring than writing documentation, but fact is that we, humans, don't like testing, but computers love this type of bandwork. And testing is necessary : adding little changes to other people's programs, break them in the most horrible ways.

I've learnt this the hard way.

A serious bug in one of our backup clients forced me to upgrade the package. No problem, just dropping the new binary in the package, relabel everything, and build the thing. Not a good idea for a package that wasn't released for over 18 months, and passed through 4 different responsible teams. The postinstall was a 300 line spaghetti mess, which in the end I ended up rewriting half of it. And still more and more bugs kept popping up, which left me terribly ashamed.
I needed a way to test automatically all of the outputs of the postinstall, and at the same time to check if all configuration files were created correctly, and if the program was able to connect automagically to the backup server.

So I decided to have a look at Test::More, and delve into the documentation, and try to write some test scripts myself. Boy, was I pleasantly surprised (as allways with Perl, but this aside) ! Within one hour, I had a test written which checked all of this stuff automatically, and even discovered 4 more bugs in the output. Needless to say that since now, I'm addicted to testing my programs.