NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
API (Score:1)
I was reading WWW::CPAN API, and I have one suggestion to the API: change the method name fetch_distmeta() to get_meta().
This reflects the fact that you're dealing with CPAN, and the word 'meta' is used by modules on CPAN, so you can avoid the word 'dist' there - CPAN deals with software distribution. And fetch IMHO seems to be too related with the medium (and it is longer than get).
For example:
my $cpan = WWW::CPAN->new;
my $meta = $cpan->get_meta({ dist => 'WWW::CPAN' });
Is more clear and less polluted than:
my $cpan = WWW::CPAN->new;
my $meta = $cpan->fetch_distmeta({ dist => "WWW::CPAN" });
Other possibility would have a WWW::CPAN::Dist class, which is a stub for actually retrieving data from CPAN, like:
my $cpan = WWW::CPAN->new;
for my $d (qw( WWW::CPAN )) {
my $meta = $cpan->dist('WWW::CPAN')->get_meta;
}
What do you think?
Igor Sutton
Reply to This
Re: (Score:1)