读书人

perl有关问题见鬼了

发布时间: 2012-02-28 13:06:35 作者: rapoo

perl问题,见鬼了!
竟然能够打印出来 “aaaa” ?

open(FILE_H, "${INIFILE} ")||die "can not open the file: $! ";

while (defined($eachline = <FILE_H> )) {

$temp = "aaaa ";

if ($temp == "tables ")
{
print "$temp \n ";

}

}
close FILE_H;

[解决办法]
应该用eq代替==

Binary "== " returns true if the left argument is numerically equal to
the right argument.

Binary "eq " returns true if the left argument is stringwise equal to
the right argument.

读书人网 >perl python

热点推荐