Skip Menu |

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

Maintainer(s)' notes

Attention bug reporters: issues MUST include the version of Module::Metadata that you are running that exhibit the stated symptoms. thank you!

Report information
The Basics
Id: 101852
Status: new
Priority: 0/
Queue: Module-Metadata

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

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



Subject: Cannot parse Devel::PatchPerl::Plugin::Compiler
erl -d:Confess -MModule::Metadata -wle'print Module::Metadata->new_from_file("lib/Devel/PatchPerl/Plugin/Compiler.pm")->version' Error evaling version line 'BEGIN { my $dummy = q# Hide from _packages_inside() #; package Module::Metadata::_version::p2; use version; no strict; no warnings; $vsub = sub { local $B::VERSION; $B::VERSION=undef; - $B::VERSION = '1.34';; $B::VERSION }; }' in /Users/ether/.cpanm/work/1422760103.38366/App-perlall-0.46/lib/Devel/PatchPerl/Plugin/Compiler.pm: Can't modify negation (-) in scalar assignment at (eval 7)[/Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm:669] line 10, at EOF BEGIN not safe after errors--compilation aborted at (eval 7)[/Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm:669] line 13, <$handle> line 117. eval 'BEGIN { my $dummy = q# Hide from _packages_inside() #; package Module::Metadata::_version::p2; use version; no strict; no warnings; $vsub = sub { local $B::VERSION; $B::VERSION=undef; - $B::VERSION = \'1.34\';; $B::VERSION }; }' called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 669 Module::Metadata::_evaluate_version_line(Module::Metadata=HASH(0x7fcdcb28eab0), "\$", "B::VERSION", "- \$B::VERSION = '1.34';") called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 601 Module::Metadata::_parse_fh(Module::Metadata=HASH(0x7fcdcb28eab0), GLOB(0x7fcdcb029a50)) called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 400 Module::Metadata::_init("Module::Metadata", undef, "/Users/ether/.cpanm/work/1422760103.38366/App-perlall-0.46/li"...) called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 105 Module::Metadata::new_from_file("Module::Metadata", "lib/Devel/PatchPerl/Plugin/Compiler.pm") called at -e line 1 at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 676, <$handle> line 117. Module::Metadata::_evaluate_version_line(Module::Metadata=HASH(0x7fcdcb28eab0), "\$", "B::VERSION", "- \$B::VERSION = '1.34';") called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 601 Module::Metadata::_parse_fh(Module::Metadata=HASH(0x7fcdcb28eab0), GLOB(0x7fcdcb029a50)) called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 400 Module::Metadata::_init("Module::Metadata", undef, "/Users/ether/.cpanm/work/1422760103.38366/App-perlall-0.46/li"...) called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 105 Module::Metadata::new_from_file("Module::Metadata", "lib/Devel/PatchPerl/Plugin/Compiler.pm") called at -e line 1 failed to build version sub for /Users/ether/.cpanm/work/1422760103.38366/App-perlall-0.46/lib/Devel/PatchPerl/Plugin/Compiler.pm at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 678, <$handle> line 117. Module::Metadata::_evaluate_version_line(Module::Metadata=HASH(0x7fcdcb28eab0), "\$", "B::VERSION", "- \$B::VERSION = '1.34';") called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 601 Module::Metadata::_parse_fh(Module::Metadata=HASH(0x7fcdcb28eab0), GLOB(0x7fcdcb029a50)) called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 400 Module::Metadata::_init("Module::Metadata", undef, "/Users/ether/.cpanm/work/1422760103.38366/App-perlall-0.46/li"...) called at /Users/ether/.perlbrew/libs/20.0@std/lib/perl5/Module/Metadata.pm line 105 Module::Metadata::new_from_file("Module::Metadata", "lib/Devel/PatchPerl/Plugin/Compiler.pm") called at -e line 1 Same behaviour on on 1.000026 and 1.000024.
This is a tricky one because the version line is in a here-document, so when looking at the line in isolation it looks to be fair game to be parsed. I propose that we do not treat a bad version line as a fatal error, so long as there was a previous line found that set the version. (The module in question doesn't set a $VERSION, but such a line could be added.) I'm not sure if we should do this silently, or always warn the error.