2008年5月20日星期二

Perl : defined 检测变量的问题

来源:perlfaq-4.54-Why does defined() return true on empty arrays and hashes?

defined 碰到 空array 或 空hash 时返回True

因此defined最好只用来检测scalar或sub,而不是检测array/hash

没有评论:

发表评论