Mon Jan 19 08:27:09 2015: Request 101569 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: Module-ScanDeps
Subject: Incorrect module parsing if Moose is included
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: [email protected]
Status: open
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=101569 >
Am 2015-01-18 18:59:11, RSCHUPP schrieb:
> Yeah, fails for me on Windows, too, but works on Linux.
OK, nailed it:
Moose puts "fake" entries into %INC, eg.
$INC{"E:\\Strawberry\\perl\\site\\lib\\Module\\ScanDeps\\DataFeed.pm"} = "(set
by Moose)";
Later on Modules::ScanDeps::DataFeed innocently tries to print
out the contents of %INC by (slightly simplified)
while (my ($k, $v) = each %INC)
{
print "$k => ", Cwd::abs_path($v), "\n";
}
Now here's the difference between Linux and Windows:
Linux:
$ perl -MCwd -E "say Cwd::abs_path('(set by Moose)'); say 'OK';"
/home/roderich/(set by Moose)
OK
but on Windows Perl (ie. Cwd.pm) throws an exception:
> perl -MCwd -E "say Cwd::abs_path('(set by Moose)'); say 'OK';"
(set by Moose): No such file or directory at -e line 1.
Please try the following patch for Module::ScanDeps.
Cheers, Roderich
--- lib/Module/ScanDeps/DataFeed.pm~ 2014-02-09 16:09:11.000000000 +0100
+++ lib/Module/ScanDeps/DataFeed.pm 2015-01-19 14:13:30.299294400 +0100
@@ -23,7 +23,7 @@
# (2) If a key in %INC was located via a CODE or ARRAY ref or
# blessed object in @INC the corresponding value in %INC contains
# the ref from @INC.
- if (defined $v && !ref $v)
+ if (defined $v && !ref $v && -e $v)
{
$_INC{$k} = Cwd::abs_path($v);
}