Subject: | Version numbers in META.yml |
Hi,
I'm not sure if it a bug in Module::Build or in YAML. Anyway the end result is that when reading data back from META.yml ending zeros in version numbers are being lost. I.e. version number 0.10 becomes 0.1.
Example Module::Build distro is attached. Autogenerated META.yml contains
--- #YAML:1.0
name: Foo
version: 0.10
license: perl
distribution_type: module
requires: {}
recommends: {}
build_requires: {}
conflicts: {}
provides:
Foo:
file: lib/Foo.pm
version: 0.10
generated_by: Module::Build version 0.20
When reading version number from this file we see 0.1 instead of 0.10:
bash-2.05b$ perl -MYAML -e 'print YAML::LoadFile("META.yml")->{version}, "\n"'
0.1
The problem is that when META.yml is read version number is treated as a Perl number not as a Perl string. As I've already said I'm not sure which module to blame. Either Module::Build should generate slighly different META.yml - use "version: '0.10'" instead of "version: 0.10" which causes version number to be read as a Perl string instead of a Perl number or YAML should not read "version: 0.10" as a Perl number.
Message body not shown because it is not plain text.