相关疑难解决方法(0)

我应该使用common :: sense还是坚持使用`use strict`和`use warnings`?

我最近从CPAN安装了一个模块,并注意到它的一个依赖项是常见的:: sense,一个模块,它提供了你想要的所有警告,没有你不需要的.从模块的概要:

use common::sense;

# supposed to be the same, with much lower memory usage, as:
#
# use strict qw(vars subs);
# use feature qw(say state switch);
# no warnings;
# use warnings qw(FATAL closed threads internal debugging pack substr malloc
#                 unopened portable prototype inplace io pipe unpack regexp
#                 deprecated exiting glob digit printf utf8 layer
#                 reserved parenthesis taint closure semicolon);
# no warnings qw(exec newline);
Run Code Online (Sandbox Code Playgroud)

除了undef警告有时候很麻烦,我通常会发现标准警告是好的.是否值得转换common::sense而不是我的正常use strict; use …

perl

15
推荐指数
7
解决办法
2305
查看次数

标签 统计

perl ×1