in reply to Searching for Modules and Descriptions on CPAN Remotely

My goal is to be able to search for Modules on CPAN with the same prefix, grab the complete name and description, then print/save the results.

Might be easier to use CPAN or CPANPLUS. Take a look at CPANPLUS::Backend. For example:

use CPANPLUS::Backend; my $cb = CPANPLUS::Backend->new; my @modules = $cb->search( type => 'module', allow => [ qr/^Test::/ ] +); print $_->name, "\n" foreach @modules

To get the module names starting with Test::

Replies are listed 'Best First'.
Re^2: Searching for Modules and Descriptions on CPAN Remotely
by ghenry (Vicar) on Jan 23, 2006 at 13:46 UTC

    How annoying!!!!

    Just when I thought I'd nailed it, CPANPLUS::Backend is just like the others I mentioned, it only returns descriptions of registered modules!

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!
      Just when I thought I'd nailed it, CPANPLUS::Backend is just like the others I mentioned, it only returns descriptions of registered modules!

      Can you define (and give an example module) of a non-registered module that you expect to appear? For example my Test::Class isn't registered and it appears in the list.

        I am searching for all the Catalyst::Plugin::* modules.

        They all appear, but because most of the authors haven't registered the namespace, the descriptions don't show:

        use strict; use warnings; use Carp; use Regexp::DefaultFlags; use CPANPLUS::Backend; my $cb = CPANPLUS::Backend->new or croak "Can't create new CPANPLUS::Backend object"; my @cat_plugins = $cb->search( type => 'module', allow => [ qr/\A Cata +lyst::Plugin/ ], ); for my $plugin (@cat_plugins) { print $plugin->name, "\n"; print $plugin->description, "\n"; }

        Walking the road to enlightenment... I found a penguin and a camel on the way.....
        Fancy a yourname@perl.me.uk? Just ask!!!
Re^2: Searching for Modules and Descriptions on CPAN Remotely
by ghenry (Vicar) on Jan 23, 2006 at 12:56 UTC

    Perfect!!

    Looks like this will do the job and then I can use CPANPLUS::Module to get the description.

    Walking the road to enlightenment... I found a penguin and a camel on the way.....
    Fancy a yourname@perl.me.uk? Just ask!!!