While investigating a Module::Scandeps bug (#22573) it appears
that the following are not equivalent (i.e. pack the same
modules into foo.exe):
pp -o foo.exe -M Foo -e 1 # (1)
pp -o foo.exe 'use Foo; 1' # (2)
when using Foo.pm:
package Foo;
1;
and Bar.pm:
package Bar;
1;
and the following addition to %Preload in Module/ScanDeps.pm:
'Foo.pm' => [qw( Bar.pm )],
In case (1) foo.exe contains only Foo.pm, while for (2)
it contains both Foo.pm and Bar.pm.
Note that when I add "use Bar;" in Foo.pm
(without any change to Module/ScanDeps.pm)
it works as expected in both cases. Looks like Foo.pm is scanned
in (1) and (2), but the implications of %Preload are only
applied for (2). This could either be a problem with Module::ScanDeps
or how it is used by PAR (pp).