因��undef回�鞯氖�undef...所以什�N都是undef... -------- Original Message -------- Subject: [PerlChina] Re: 新手请教defined和undef的用法 From: 方伟 <[email protected]> To: [email protected] Date: 18/1/2011 23:17 > 我自己试了一下,还是搞不懂 > $num=100; > if(undef($num)){print "it's undefined";}else{print "it's defined";} > 输出结果是it's defined > > 去掉第一行: > if(undef($num)){print "it's undefined";}else{print "it's defined";} > 输出结果还是it's defined > > 在 2011年1月18日 下午10:52,方伟 <[email protected]> 写道: >> 在教程上看到这样的用法:if (defined($name)) 以及 $name=undef; >> 我想知道能不能反过来用呢,这样子行不行:if (undef($name)) 以及 $name=defined; >>
-- 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
