Skip Menu |

This queue is for tickets about the Module-Find CPAN distribution.

Report information
The Basics
Id: 24477
Status: resolved
Priority: 0/
Queue: Module-Find

People
Owner: crenz [...] cpan.org
Requestors: UVOELKER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.05
Fixed in: (no value)



Subject: double modules
Module::Find reports modules several times, if they are more than one time in @INC. This happens when you develop CPAN modules and have an older version installed (site und blib directory). I always have to write something like this: my @DATA_CLASS = keys %{{map { $_ => 1 } useall RestWeb::Data}}; I can send you a patch, if you are interested. (But my last mail to you got unanswered.) Thanks.
From: UVOELKER [...] cpan.org
Thank you.
Index: Find.pm =================================================================== --- Find.pm (Revision 183) +++ Find.pm (Arbeitskopie) @@ -181,6 +181,10 @@ no_chdir => 1}, $basedir); } + # filter duplicate modules + my %seen = (); + @results = grep { not $seen{$_}++ } @results; + @results = map "$category\::$_", @results; return @results; }
Index: test/double/ModuleFindTest/SubMod.pm =================================================================== --- test/double/ModuleFindTest/SubMod.pm (Revision 0) +++ test/double/ModuleFindTest/SubMod.pm (Revision 0) @@ -0,0 +1,3 @@ +package ModuleFindTest::SubMod; + +$ModuleFindTest::SubMod::loaded = 1; Index: t/6-bugs.t =================================================================== --- t/6-bugs.t (Revision 0) +++ t/6-bugs.t (Revision 0) @@ -0,0 +1,14 @@ +use Test::More tests => 1; + +use Module::Find; + +use lib qw(./test); +use lib qw(./test/double); + +my @l; + +# double modules + +@l = useall ModuleFindTest; + +ok($#l == 1);
Uwe, sorry for leaving this open more than a year! I included your patch into 0.06, which should appear on CPAN any minute now.