The Perlbuzz section CPAN Watch is going on an indefinite hiatus. Kirrily Robert, Skud, who has driven CPAN Watch since its start, is moving to San Francisco from Australia, and just doesn't have the time to keep things going.

I'll still be keeping you informed about cool new CPAN releases, but instead of CPAN Watch I'll be putting them in the Mechanix section. So, point your RSS/Atom readers over there for now.

David Cantrell writes to the module-authors list about his new CPAN module dependency tracker:
I've just uploaded CPAN::FindDependencies version 2 to the CPAN. This is pretty much a complete re-write which has lots of cool new Stuff:
  • uses Parse::CPAN::Packages instead of CPAN.pm, so loads faster and takes a lot less memory;
  • much better core module detection;
  • user can specify which version of perl to use when figuring out what's in core;
  • can cache META.yml files and use a local 02packages file instead of fetching it from a CPAN mirror at startup;
  • add 'maxdepth' parameter to limit how far down the dependency tree it goes;
  • much better tests;
  • 'cpandeps' script is now documented
Why am I telling you this? Cos, for the perl-qa folks, this will be the new brane for http://cpandeps.cantrell.org.uk/ soon. For the module-authors list - the bundled 'cpandeps' program is a useful tool for getting an idea of how much extra code gets pulled in when you make your users install a dependency. Re-using code is a Good Thing of course, but taken to extremes it can be a real pain in the arse for those for whom perl is just another environment that they have to support on their machines.

I wrote about David's dependency checker before, and it's pretty slick.

Yann Kerherve has released Find::Lib, an alternate way of loading libraries in non-standard locations. Find::Lib lets you specify paths like so:

use base Find::Lib '../bootstrap/lib' => 'My::Bootstrap', %param;

I'd love to hear from anyone who's used it and what they think.

ack is my replacement for grep geared to large source trees. I've just released 1.75_01 (a developer release, please note) which is a big speedup for what I suspect is the most common case of scanning large directories of many relatively (<100K) small files and not finding matches in all of them.

Here's what it does: It checks the size of each file, and if it's <100K, slurps up the entire file. Then, it scans the entire 100K file at once, and if there are no matches, then there's no need to do the line-by-line more expensive searching.

In my test scanning a couple of big source directories like ~/parrot, it saved about 40% run-time. If I had -C or -B to store context, it saved about 70% run-time because the saving of context is more expensive.

So, please, check it out and make sure all is still working. Also, any eyes on the algorithm I'm using would be appreciated, too. I'm sure I can do things cleaner or a bit more speedily, but right now I'm mostly worried about accuracy.

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.

File::Path, a core Perl module for creating and deleting directory trees, is now dual-lifed. This means it's part of the Perl core, and it's also released on CPAN separately, so updates can happen in the module without waiting for Perl releases. David Landgren is the maintainer of the CPAN-based distribution.

The latest version is 2.02, and recent changes include:

  • security vulnerability due to a race condition fixed
  • compatible across all versions from 5.005 to 5.10.0
  • new modern API style introduced (the old API still works)
  • new "keep_root" functionality added (to remove everthing with a directory but leaving the directory itself intact.
  • a better test suite and a documentation rewrite

Module::Starter 1.44 has been released, and it's been a long time coming. Module::Starter makes it trivial to start a new CPAN distribution, without having to create the parts from memory from scratch, or cutting & pasting from an existing module. Where the standard h2xs tool that ships with Perl creates the .pm file for you, Module::Starter creates an entire distribution.

In the two years since the last non-developer release, features added include:

  • Improved support for Perl::Critic
  • Now easier to build your own Module::Starter extensions
  • Support for Module::Install
  • Improved test suite

Thanks to Ricardo Signes for picking up my slack on this. Although I originally wrote Module::Starter, it's more Ricardo's work than mine at this point.

Other Perl Sites

Other Swell Blogs

  • geek2geek: An ongoing analysis of how geeks communicate, how we fail and how to fix it.
Technorati Profile