CC: | matthew.persico [...] gmail.com |
Subject: | Repeated results from pminst |
Some expansions of @INC have subdirs of other @INC directories in them.
If @INC contains
/opt/perl/lib/site_perl/5.8.8
/opt/perl/lib/site_perl
then when looking for module Foo, the output will be
Foo
5.8.8:Foo
The fix is to retain the full path of any module printed and skip
processing it the next time it is encountered. I have attached a patch.
Subject: | pminst.patch |
23c23
< use vars qw($opt_l $opt_s);
---
> use vars qw($opt_l $opt_s %seen);
35c35,44
< return unless /\.pm$/;
---
> # Some expansions of @INC have subdirs of other @INC directories in them;
> # to wit:
> # /opt/perl/lib/site_perl/5.8.8
> # /opt/perl/lib/site_perl
> # This will result in output, when looking for module Foo:
> # Foo
> # 5.8.8:Foo
> # We add full module paths for found modules to %seen so
> # we can skip them the next time around.
> return unless ( /\.pm$/ and not exists $seen{$File::Find::name} );
49a59
> $seen{$File::Find::name}=1;