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

perl 异常总结

发布时间:2020-12-16 00:01:09 所属栏目:大数据 来源:网络整理
导读:1. Pseudo-hashes are deprecated The "Pseudo-hashes are deprecated" error means you're trying to access an array as a hash,which means that either $data-{file} or $data-{file}{path} is an arrayref. 2.? defined 解释 ? 用于判断变量是否为 unde

1. Pseudo-hashes are deprecated

The "Pseudo-hashes are deprecated" error means you're trying to access an array as a hash,which means that either$data->{file} or$data->{file}{path} is an arrayref.


2.? defined 解释

? 用于判断变量是否为 undef,未定义, 不能用于数组和hash

Many folks tend to overuse defined and are then surprised todiscover that the number0 and "" (the zero-length string) are,in fact,defined values.

? 0 and "" (the zero-length string 用 if () 来判断即可

3.? or? ||?? 和 and &&的区别

本身没有区别,习惯问题 ,但是有时候牵涉到运算符优先级的问题,结果会不同
??????????left? ?? ???&
? ?? ?? ???left? ?? ???| ^
? ?? ?? ???left? ?? ???&&
? ?? ?? ???left? ?? ???|| //
? ?? ?? ???nonassoc? ? ..??...
? ?? ?? ???right? ?? ? ?:
? ?? ?? ???right? ?? ? = += -= *= etc.
? ?? ?? ???left? ?? ???,=>
? ?? ?? ???nonassoc? ? list operators (rightward)
? ?? ?? ???right? ?? ? not
? ?? ?? ???left? ?? ???and ? ?? ?? ???left? ?? ???or xor

(编辑:李大同)

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

    推荐文章
      热点阅读