WWW::CPAN is a work in progress (slow progress, to be honest). At 0.004 release, its API got one more method, query(). The whole API is:
Ain't that promising? Everyone will use it when 0.999 release arrives. (Yes, updates are by +0.001 increments.)
my $cpan = WWW::CPAN->new;
my $meta = $cpan->get_meta({ dist => 'WWW::CPAN' });
my $cpan = WWW::CPAN->new;
my $meta = $cpan->fetch_distmeta({ dist => "WWW::CPAN" });
my $cpan = WWW::CPAN->new;
for my $d (qw( WWW::CPAN )) {
my $meta = $cpan->dist('WWW::CPAN')->get_meta; ...
}
Re:API
ferreira on 2008-01-15T11:14:41
Those sound like very elegant ideas and I will think harder about them in the next days. The reason I went with "fetch_distmeta" was to anticipate the occurrence of other meta data beyond CPAN distributions, like authors. And "fetch" was chosen instead of "get" because the latter reminded me only simple accessor rather than a real action to retrieve some data. But I am thinking about it. Thanks for your feedback, Igor.