Versions of modules used in the test report

BooK on 2004-07-27T11:54:12

I can't remeber in whose journal I read that, but I still remember a discussion about diag()ing the versions of the modules used during the tests, so that a FAIL is more useful.

I've come up with this:

use Test::More tests => 1;

for my $module ( qw(
    Test::More
    ...
) ) {
    eval "require $module;";
    diag $@ ? "$module not installed"
            : "$module version " . UNIVERSAL::VERSION($module);
}
ok(1, "Dummy test" );

Is there's already something like this somewhere? Is there's a better way?