显式 "use"-ing 各种 Perl 版本的后果是什么?
What are the consequences of explicitly "use"-ing various Perl versions?
我正在学习 Perl,对最新版本的默认值和更改没有太多经验。例如,我将 use v5.10;
放在所有脚本的开头(即使我安装了 5.28.1 版),以便我可以安全地使用 say()
函数。显然,“使用”-ing v5.12
将默认启用 strict
。
“使用”-ing v5.10
或 v5.12
还有哪些其他变化?最近的版本做了哪些更改?有个人或开源项目常用的版本吗?
使用特定最低版本的效果记录在 https://perldoc.perl.org/feature#FEATURE-BUNDLES 中。简而言之,启用了较新的功能并打开了严格检查。
这是页面的摘录:
bundle features included
--------- -----------------
:default indirect
:5.10 say state switch indirect
:5.12 say state switch unicode_strings indirect
[also does the equivalent of use strict;]
[...]
:5.28 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
postderef_qq bitwise indirect
[also does the equivalent of use strict;]
:5.30 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
postderef_qq bitwise indirect
[also does the equivalent of use strict;]
:5.32 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
postderef_qq bitwise indirect
[also does the equivalent of use strict;]
我正在学习 Perl,对最新版本的默认值和更改没有太多经验。例如,我将 use v5.10;
放在所有脚本的开头(即使我安装了 5.28.1 版),以便我可以安全地使用 say()
函数。显然,“使用”-ing v5.12
将默认启用 strict
。
“使用”-ing v5.10
或 v5.12
还有哪些其他变化?最近的版本做了哪些更改?有个人或开源项目常用的版本吗?
使用特定最低版本的效果记录在 https://perldoc.perl.org/feature#FEATURE-BUNDLES 中。简而言之,启用了较新的功能并打开了严格检查。
这是页面的摘录:
bundle features included
--------- -----------------
:default indirect
:5.10 say state switch indirect
:5.12 say state switch unicode_strings indirect
[also does the equivalent of use strict;]
[...]
:5.28 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
postderef_qq bitwise indirect
[also does the equivalent of use strict;]
:5.30 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
postderef_qq bitwise indirect
[also does the equivalent of use strict;]
:5.32 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
postderef_qq bitwise indirect
[also does the equivalent of use strict;]