perl滑动匹配核心代码

前端之家收集整理的这篇文章主要介绍了perl滑动匹配核心代码前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

 if ($ansfline eq "\"data\"")
        {
        $dataflag=1;
        next;
      }
     if($dataflag==1)
     {
      
      #以下代码滑动匹配时间
      if($compflag==0)
      {  if ($ansfline<=$result_time1)
          {
            $compflag=1;
            $pre2=tell(ansf1);
           
         
         }
       }
       elsif($compflag==1)
       { 
          if ($ansfline>=$result_time2)
          {
            $compflag=2;
           
         
         }
        #elsif($ansfline<=$result_time1)
        #{
        #   $compflag=1;             
        #}
         else
         {
          #$position_minus=$position-$pre;
            seek(ansf,$pre,0);   #回退1行
             $position_change = tell(ansf);
            
             #print "position minus 1 is $position_change\n";
             $compflag=0;
         }
        
          
                    
       }
       elsif($compflag==2)
       {
           if($ansfline=~/"\*"/)
           {
            #print "find\n";
            $result_total+=$result_time2-$result_time1;
            print(frecOut "find $resfline in $resFile is not match in $ansFile\n");
           }
           else
           {
            
             #seek(ansf,0);
             seek(ansf,$pre2,0);     #回退两行
             $position_change = tell(ansf);
            
             #print "position minus 2 is $position_change\n";

           }                        $compflag=0;                              }               }               }   

猜你在找的Perl相关文章