我想在一个地方为几个项目设置相同的版本。我试过了:
use ExtUtils::MakeMaker;
WriteMakefile(
VERSION_FROM => 'lib/project/version.pm',
...
在“lib/project/version.pm”中:
package project::version;
use AnotherProject;
our $VERSION = AnotherProject->VERSION();
1;
注意:AnotherProject 位于单独的目录中,但可以通过“使用 AnotherProject”加载。并包含'我们的 $VERSION="1.00" '。
$ perl Makefile.PL
WARNING: Setting VERSION via file 'lib/project/version.pm' failed
at /usr/lib64/perl5/5.18.2/ExtUtils/MakeMaker.pm line 599.
Can't parse version 'undef'
是否可以从另一个模块传递(获取)版本字符串?
也许还有其他方法可以做到这一点,请支持我。