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.