小编Ris*_*iss的帖子

Perl String Compare失败

以下是代码示例:

while (@filelines){
  #splice the line to a array 
  print "the string to be compared is $filelines[$i] with $FN_Accessories_Header\n";

  if (chomp($filelines[$i]) eq $FN_Accessories_Header){
    print "The file name is FN_Accessories.csv and first line is header\n";
  }
  else {
    print "The scanning process will be terminated as the first line is not header\n";
    exit;
  }
}
Run Code Online (Sandbox Code Playgroud)

两个变量的内容相同,但if语句中的print不会执行.

asd_bsd;asdf_asdf;weroi_asdf;asdf_asdf;asdf_wer;rty_tyu;sdf_erty;qwe_123;asdffff_asdfrs;

string perl compare

-2
推荐指数
1
解决办法
82
查看次数

标签 统计

compare ×1

perl ×1

string ×1