November 2007 Archives

Here's another problem I'd never considered, and I'm now glad that it's handled by code that already exists (and has now been recently updated). Adam Kennedy's Chart::Math::Axis module helps with a most basic issue of drawing charts:

Chart::Math::Axis implements in a generic way an algorithm for finding a set of ideal values for an axis. That is, for any given set of data, what should the top and bottom of the axis scale be, and what should the interval between the ticks be.

I also point out that the paragraph above, from the synopsis of the module, is what all modules' synopsis sections should aspire to. It explains in clear language what the module does, and without describing it in terms of other modules.

The long-awaited Test::Harness 3.00 is now out on CPAN. It's a complete rewrite of Test::Harness, abandoning all the code from 2.x. The list of new features is huge:
  • Parallel testing. You can now say prove -j2 t/ and get parallel testing.
  • Better timing support
  • Ability to archive TAP from individual tests, making detective work easier, and allowing you to send results easily to an aggregator/reporter like Smolder.
  • Better support for CPAN::Reporter
  • Far more flexible API, with the removal of Straps.

Test::Harness 3.00 is a drop-in replacement for the 2.x series, unless you're using Straps. If so, you'll want the compatibility package of Test::Harness::Straps. If you don't even know what Straps are, then chances are you're not using them.

Test::Harness now has a new maintainer as well. Andy Armstrong has taken over the maintenance duties for the 3.x series, while Yours Truly will still maintain the 2.x series if serious bugs crop up.

(Be sure to read my interview with Andy Armstrong about the road to T::H 3.00.)

I don't usually bother with little maintenance releases, but Devel::Cover is a crucial module that should be in any module author's arsenal, and it's been nine months since its last release. Most of the enhancements are minor ("quieten some warnings," "tidy up filename normalisation"), but I suspect the table sorting in the HTML reports will be a boon to those with big modules.

Most of all, I urge any module author who has not yet used Devel::Cover to check the test coverage of her test suite to do so today. Devel::Cover is an amazing module that will probably uncover at least one hole in your test coverage, and may even find a place where bugs can get out untested. It's that good.

ack, my replacement for grep for 95% of the times programmers use grep, just got released to CPAN with version 1.70.

At long last, you can now get contextual lines before and after matched lines, just like GNU grep's -A, -B and -C options. You can also match on a specific line number or range of line numbers with the new --line option. For example, if you want to see the first line of every Perl file in a tree, you'd just do ack --line=1 --perl. Thanks very much to Torsten Biix for putting both these features together for me.

Finally, Elliot Shank pointed out that one of my favorite features, the -1 option, was never documented. Now it is. The -1 option says "stop after the first match of any type." If you find yourself acking for lines, or searching for a specific file with ack -g and then having to Ctrl-C to stop the search process, just add a -1 and Ctrl-C no longer.

ack is available in the ack distribution on CPAN, or by installing the module App::Ack from the CPAN shell. You can also download the single-file version direct from Subversion and drop it right into your ~/bin directory.

About this Archive

This page is an archive of entries from November 2007 listed from newest to oldest.

October 2007 is the previous archive.

December 2007 is the next archive.

Find recent content on the main index or look in the archives to find all content.

Technorati Profile