Subject: | issues with scan_deps()'s files option and @INC |
issues with scan_deps()'s files option and @INC
if you do
scan_deps('\someplace\NOT\IN\INC\with\modules\for\FOO.pl');
lots of dependencies won't be listed cause they won't be found in
@INC, and unless you yourself look at the source(FOO.pl),
you'll have no idea what got left out.
There are several remedies, the easiest of which is adding
this information to the CAVEATS section.
The 2nd easiest solution is to simply
add the module to the list like so (issue a warning as well):
'Bar.pm' => {
'file' => undef, ### cause you couldn't find it
'type' => 'module',
'key' => 'Bar.pm',
'used_by' => [
'Foo.pm'
]
}
That way if somebody runs into the @INC issue,
they'll be able to figure it out.
The third solution is to modify scan_deps like so
...
foreach my $file (@{$files}) {
my $key = shift @{$keys};
next if $skip->{$file}++;
push @INC, File::Basename::dirname $file;
...
pop @INC;
}
but that's kind of ugly.
Thanx