1

一个模块至少需要 Perl 5.10.0。

当我将此模块与 Perl 版本 5.10.0 一起使用时,我收到警告:

v-string in use/require non-portable at ... (line of "use 5.10.0;").

在 Perl 5.10.1 中,这个警告被删除了。

避免警告的推荐方法是什么:

- change all "use 5.10.0" in the distro to "use 5.010_000;"

- add "no warnings 'portable';" to the module

- leave it to the user of Perl 5.10.0 to add "no warnings 'portable';"

- Increase the smallest required version to 5.10.1. 

perl -wE 'use 5.10.0; say $^V'
# v-string in use/require non-portable at -e line 1.
# v5.10.0
4

1 回答 1

2

如果您需要 5.10.0 及更高版本的任何内容,则无需指定次要版本:

use v5.10;

您可能会考虑使用至少 5.10.1,它对早期的次要版本有一些重大更改(包括修复您的警告):

use v5.10.1;

但是,给我们一个示例程序,展示你正在使用的 Perl 以及所有其他的东西。

于 2013-12-24T21:07:26.730 回答