gpt4 book ai didi

Perl:使用 5.##.# 中包含什么?

转载 作者:行者123 更新时间:2023-12-04 05:48:27 25 4
gpt4 key购买 nike

我见过好几个posts那个状态use 5.12.0;在 Perl 中默认启用某些功能/编译指示(例如, use strict; )。另一个例子是在 UTF-8 and perl据说 use 5.14.0;

optimal for Unicode string feature UTF-8 handling.



我似乎记得一个可用的 use提供某些默认值的声明(例如, use strict; use warnings; use diagnostics; ),但不记得具体细节。如何找出给定 use 5.##.#; 中包含的内容陈述?例如,什么是 use 5.22.0;默认提供? use strict; ?

最佳答案

这记录在 perldoc feature 中:

It's possible to load multiple features together, using a feature bundle. The name of a feature bundle is prefixed with a colon, to distinguish it from an actual feature.

use feature ":5.10";

The following feature bundles are available:

bundle    features included
--------- -----------------
:default array_base
:5.10 say state switch array_base
:5.12 say state switch unicode_strings array_base
:5.14 say state switch unicode_strings array_base
:5.16 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
:5.18 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
:5.20 say state switch unicode_strings
unicode_eval evalbytes current_sub fc
:5.22 say state switch unicode_strings
unicode_eval evalbytes current_sub fc


在哪里

use v5.10.0;

will do an implicit

no feature ':all';
use feature ':5.10';

and so on.



自动启用限制记录在 perldoc -f use 中:

if the specified Perl version is greater than or equal to 5.12.0, strictures are enabled lexically as with use strict.

关于Perl:使用 5.##.# 中包含什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31257555/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com