http://qs1969.pair.com?node_id=1193741


in reply to Very Odd Issue When Using pp to Create an .exe File Including Date::Calc

pp uses Module::ScanDeps to find dependencies, and it looks like it is not properly parsing lines containing /use\s+\d/

Using the current version of Module::ScanDeps:

perl -MModule::ScanDeps -e"print $Module::ScanDeps::VERSION" 1.23

and shortening the code somewhat:

use utf8; use strict; use List::Util qw(max); use Date::Calc qw(Delta_ +Days); use 42;

And then running it through scandeps.bat (in this case the code is in use_on_one_line_42_at_end.pl).

scandeps use_on_one_line_42_at_end.pl 'Portable' => '1.22', 'File::Which' => '1.21', 'CryptX' => '0.044', 'Portable::CPAN' => '1.22', 'Portable::Config' => '1.22', 'Portable::HomeDir' => '1.22', 'Portable::LoadYaml' => '1.22', 'Portable::minicpan' => '1.22', 'Portable::FileSpec' => '1.22', 'File::HomeDir' => '1.00', 'File::HomeDir::Darwin::Carbon' => '1.00', 'File::HomeDir::Darwin::Cocoa' => '1.00', 'File::HomeDir::FreeDesktop' => '1.00', 'File::HomeDir::MacOS9' => '1.00', 'File::HomeDir::Test' => '1.00', 'File::HomeDir::Windows' => '1.00', 'File::HomeDir::Unix' => '1.00', 'File::HomeDir::Darwin' => '1.00', 'File::HomeDir::Driver' => '1.00', 'Math::BigInt::GMP' => '1.6003', 'Math::BigInt::LTM' => '0.044',

The above also does not list List::Util, but that can be done using the -B flag in the scandeps.pl call

In fact, the issue also manifests in one-liners as these two are also missing Date::Calc in their outputs:

scandeps -e"use 5.022; use Date::Calc" scandeps -e"use Date::Calc; use 5.022"

But on further checking, it is triggered for any value >= 5.01

These list Date::Calc and Date::Calc::PP

scandeps -e"use 5.009; use Date::Calc" scandeps -e"use 4; use Date::Calc"

This does not:

scandeps -e"use 5.01; use Date::Calc"

And for general reference:

scandeps -e"use 5.009;" No modules found!

It can also be reproduced using other modules. This one-liner does not list Text::CSV_XS.

scandeps -e"use 5.01; use Text::CSV_XS"

It is probably worth raising as a Module::ScanDeps issue.