Commit | Line | Data |
---|---|---|
3a02dfe7 RGS |
1 | #!/usr/local/perl5.6.1/bin/perl -w |
2 | use strict; | |
3 | use warnings; | |
4 | use Module::CoreList; | |
5 | ||
6 | use vars qw/%modules/; | |
7 | ||
8 | my @files = @ARGV; | |
9 | unless (@files) { | |
10 | print "$0: using test scripts\n"; | |
11 | @files = grep { -e $_ } 'test.pl', glob 't/*.t'; | |
12 | } | |
13 | ||
14 | print "$0: checking ", join(', ', @files), "\n"; | |
15 | ||
16 | my @used; | |
17 | for (@files) { | |
18 | open my $fh, "$^X -Mblib -MModule::CoreList=dumpinc $_|" | |
19 | or die "couldn't fork $!"; | |
20 | while (<$fh>) { last if /^---INC---/ } | |
21 | push @used, map { chomp; s{/}{::}g; s{\.pm$}{}; $_ } <$fh>; | |
22 | } | |
23 | ||
24 | *modules = \%Module::CoreList::version; | |
25 | my %uniq = map { $_ => 0 } grep { !exists $modules{$]}{$_} } @used; | |
26 | ||
27 | use Data::Dumper; | |
28 | print Dumper \%uniq; |