I'm trying to use CPANPLUS to query modules. Looking at the documentation, I thought the following would work:
#! /usr/local/bin/perl -wl use strict; use CPANPLUS::Backend; my $cb = CPANPLUS::Backend->new; for my $dist( @ARGV ) { my $res = $cb->search( type => 'module', allow => [], data => [qr/$dist/], ); use Data::Dumper; print Dumper($res); }
Running this with '^Text::' on the command line should spit out all the modules in the Text namespace with their current version. And then I could smoke test them. Except that it doesn't, it crashes with:
Can't locate object method "module" via package "Regexp" at /usr/local +/lib/perl5/site_perl/5.8.7/CPANPLUS/Internals/Search.pm line 166.
But... the documentation for CPANPLUS::Backend::search says:
"search" enables you to search for either module or author objects, based on their data. The "type" you can specify is any of the accessors specified in "CPANPLUS::Module::Author" or "CPANPLUS::Module". "search" will determine by the "type" you specified whether to search by author object or module object.
... and CPANPLUS::Module declares a search module accessor. 'use'ing the module explicitly in the script doesn't fix it either. Can somebody point out the error of my ways?
• another intruder with the mooring in the heart of the Perl
In reply to Using CPANPLUS::Backend to query CPAN metadata by grinder
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |