Posted on 2005-03-26 07:36:14-08 by szabgab
duplicate distributions ?
I was using this module to populate the database of CPAN::Forum with the names of distributions.
I have just noticed that I get several distributions fetched twice from the source file
This piece of code would demonstrate it:
use Parse::CPAN::Packages; my $p = Parse::CPAN::Packages->new("02packages.details.txt"); my @distributions = $p->distributions; my %seen; foreach my $d (@distributions) { # skip scripts #next if not $d->prefix or $d->prefix =~ m{^\w/\w\w/\w+/scripts/}; my $dist = $d->dist; if (not $dist) { warn "No dist encountered\n"; next; } if ($seen{$dist}++) { warn "$dist seen already\n"; } }
e.g. I get Zanas twice.

Is this a bug or a feature or am I using the module incorrectly ?

Direct Responses: 317 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.