Skip Menu |

This queue is for tickets about the Module-ScanDeps CPAN distribution.

Report information
The Basics
Id: 72954
Status: resolved
Priority: 0/
Queue: Module-ScanDeps

People
Owner: RSCHUPP [...] cpan.org
Requestors: RSCHUPP [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.07
Fixed in: (no value)



Packing (PAR::Packer) the following script binmode STDOUT, ":encoding(UTF-8)"; results in Unknown PerlIO layer "encoding" at script/foo.pl line 5. Reason: ":encoding(UTF-8)" is recognized by M::SD (cf. line ~915 in scan_chunk), but has no consequence, because UTF-8 isn't handled by an "external" encoding module. It also fails to include Encode.pm which is needed at script runtime as well. Solution: make the rule always return Encode.pm (plus potentially other modules).
Proposed fix: diff -ubr Module-ScanDeps-1.07/lib/Module/ScanDeps.pm Module-ScanDeps-next/lib/Module/ScanDeps.pm --- Module-ScanDeps-1.07/lib/Module/ScanDeps.pm 2011-11-28 16:51:47.000000000 +0100 +++ Module-ScanDeps-next/lib/Module/ScanDeps.pm 2011-12-05 12:05:39.385682000 +0100 @@ -914,8 +914,10 @@ return "DBD/$1.pm" if /\b[Dd][Bb][Ii]:(\w+):/; if (/(?:(:encoding)|\b(?:en|de)code)\(\s*['"]?([-\w]+)/) { my $mod = _find_encoding($2); - return [ 'PerlIO.pm', $mod ] if $1 and $mod; - return $mod if $mod; + my @mods = ( 'Encoding.pm' ); # always needed + push @mods, 'PerlIO.pm' if $1; # needed for ":encoding(...)" + push @mods, $mod if $mod; # "external" Encode module + return \@mods; } return $1 if /^(?:do|require)\s+[^"]*"(.*?)"/; return $1 if /^(?:do|require)\s+[^']*'(.*?)'/;
Fix commited