Subject: | Newlines Prevent Finding Dependencies |
When a use statement spans more than one line, the dependency is not found.
I created an md_test directory in my home directory. I created three files in that directory: MyModule.pm, my_script_1.pl and my_script_2.pl.
MyModule.pm
-----------
package MyModule;
use 5.001;
use strict;
use warnings;
require Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(some_function another_function);
sub some_function {
print "This is some_function in MyModule.\n";
}
sub another_function {
print "This is another_function in MyModule.\n";
}
1;
my_script_1.pl
--------------
#!/usr/bin/perl
use strict;
use warnings;
use MyModule qw(some_function);
some_function();
my_script_2.pl
--------------
#!/usr/bin/perl
use strict;
use warnings;
use MyModule qw(some_function
another_function);
some_function();
another_function();
I ran the indexer from my home directory:
indexer.plx -o ./md_test.dat -t -b md_test
Then I compared the dumps:
dumper.plx -o ./md_test.dat -i my_script_1.pl
dumper.plx -o ./md_test.dat -i my_script_2.pl
my_script_1.pl shows the dependency on MyModule.pm but my_script_2.pl does not.
I'm using Module-Dependency-1.13 on perl v5.8.3 built for i686-linux.