Discussion:
[rt.cpan.org #109110] Incompatible with Module::ScanDeps 1.20
(too old to reply)
Neubauer, Ralf via RT
2015-11-18 13:49:08 UTC
Permalink
Wed Nov 18 08:49:08 2015: Request 109110 was acted upon.
Transaction: Ticket created by ***@wido.bv.aok.de
Queue: PAR-Packer
Subject: Incompatible with Module::ScanDeps 1.20
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@wido.bv.aok.de
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=109110 >


Using pp results in:

Can't use string ("1") as an ARRAY ref while "strict refs" in use at c:/strawberry-5.22.0.1-32/perl/site/lib/Module/ScanDeps.pm line 1085.

This code in PAR-Packer-1.026:

my $preload = Module::ScanDeps::_get_preload($module) or next;

$add_deps->(
used_by => $file,
rv => \%map,
modules => $preload,
skip => \%skip,
# warn_missing => $args->{warn_missing},
);
push @files, map {&$inc_find($_)} @$preload;

is incompatible with the change in Module:ScanDeps between version 1.19 and 1.20:

1.19:
sub _get_preload {
my $pm = shift;
my $preload = $Preload{$pm} or return();
if ($preload eq 'sub') {
$pm =~ s/\.p[mh]$//i;
$preload = [ _glob_in_inc($pm, 1) ];
}
elsif (UNIVERSAL::isa($preload, 'CODE')) {
$preload = [ $preload->($pm) ];
}
return $preload;
}

1.20:
sub _get_preload {
my ($pm, $seen) = @_;
$seen ||= {};
$seen->{$pm}++;
my @preload;

foreach $pm (_get_preload1($pm))
{
next if $seen->{$pm};
$seen->{$pm}++;
push @preload, $pm, _get_preload($pm, $seen);
}
return @preload;
}

Changing the above code to

my @preload = Module::ScanDeps::_get_preload($module) or next;

$add_deps->(
used_by => $file,
rv => \%map,
modules => \@preload,
skip => \%skip,
# warn_missing => $args->{warn_missing},
);
push @files, map {&$inc_find($_)} @preload;

seems to help, but of course needs Module-ScanDeps-1.20 .

Ralf
Roderich Schupp via RT
2015-11-18 17:03:40 UTC
Permalink
Wed Nov 18 12:03:38 2015: Request 109110 was acted upon.
Transaction: Correspondence added by RSCHUPP
Queue: PAR-Packer
Subject: Incompatible with Module::ScanDeps 1.20
Broken in: (no value)
Severity: (no value)
Owner: Nobody
Requestors: ***@wido.bv.aok.de
Status: new
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=109110 >
Post by Neubauer, Ralf via RT
Can't use string ("1") as an ARRAY ref while "strict refs" in use at
c:/strawberry-5.22.0.1-32/perl/site/lib/Module/ScanDeps.pm line 1085.
Thanks for reminding me, the adjustment was already on my disk.
Fixed in PAR::Packer, just released to CPAN.

Cheers, Roderich

Loading...