加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 大数据 > 正文

perl – 在使用严格时是否有必要使用警告?

发布时间:2020-12-15 21:39:19 所属栏目:大数据 来源:网络整理
导读:代码如下: use strict;use warnings; 是使用警告;在这需要吗? 解决方法 是的,这是必要的. 使用严格和使用警告做不同的事情. 从严格模块的手册页: strict ? Perl pragma to restrict unsafe constructs 来自perlrun(for -w): prints warnings about dubio
代码如下:
use strict;
use warnings;

是使用警告;在这需要吗?

解决方法

是的,这是必要的.

使用严格和使用警告做不同的事情.

从严格模块的手册页:

strict ? Perl pragma to restrict unsafe constructs

来自perlrun(for -w):

prints warnings about dubious constructs,such as variable names that are mentioned only once and scalar variables that are used before being set,redefined subroutines,references to undefined filehandles or filehandles opened read-only that you are attempting to write on,values used as a number that don’t look like numbers,using an array as though it were a scalar,if your subroutines recurse more than 100 deep,and innumerable other things.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读