我最近从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 ×1