首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

perl有关问题,见鬼了

2012-02-28 
perl问题,见鬼了!竟然能够打印出来“aaaa”?open(FILE_H,${INIFILE} )||die cannotopenthefile:$! whil

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.

热点排行