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: 90783
Status: open
Priority: 0/
Queue: Module-Metadata

People
Owner: Nobody in particular
Requestors: tokuhirom+cpan [...] gmail.com
Cc: ether [...] cpan.org
AdminCc:

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



Subject: Module::Metadata can't parse "our \$VERSION = '0.01'"
Following test code fails with latest M::Metadata. - 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< - use strict; use warnings; use Test::More tests => 1; use Module::Metadata; note "VERSION: $Module::Metadata::VERSION\n"; my $info = Module::Metadata->new_from_handle(*DATA, 'foo.pm'); is $info->version, '0.01'; __DATA__ package foo; <<'...'; our \$VERSION = '$Mouse::Spec::VERSION'; ... our $VERSION = "0.01"; 1; - 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< - The output is: - 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< -- 8< - 1..1 # VERSION: 1.000019 Error evaling version line 'BEGIN { my $dummy = q# Hide from _packages_inside() #; package Module::Metadata::_version::p1; use version; no strict; no warnings; $vsub = sub { local $VERSION; $VERSION=undef; our \$VERSION = '$Mouse::Spec::VERSION';; $VERSION }; }' in /home/tokuhirom/tmp/20131125/foo.pm: syntax error at (eval 11) line 10, near "our \" BEGIN not safe after errors--compilation aborted at (eval 11) line 13, <DATA> line 4. failed to build version sub for /home/tokuhirom/tmp/20131125/foo.pm at hoge.pl line 9. # Looks like your test exited with 255 before it could output anything.
Show quoted text
> our \$VERSION = '$Mouse::Spec::VERSION';
I've seen that too. But I never knew why people did that. Can you help me understand?
It does appear that EUMM handles this in its regex, making sure that the $VERSION isn't preceded by a backslash. https://metacpan.org/source/BINGOS/ExtUtils-MakeMaker-6.84/lib/ExtUtils/MM_Unix.pm#L2705