title: how to make pair string comparision from csv file in perl
body: <p>i have a problem with the code to make string pair comparison. my data in csv file as below</p>
  
  <pre>
  WorkerId,query,sysa,sysb,Answer.selectedsys
  
  A2ZBU2WW9WHXB7,male,lucene-std-rel,random,lucene-std-rel
  A2ZH0XH25HXD1Y,male,lucene-std-rel,random,lucene-std-rel
  
  A1V89RF7V0DCF5,male,lucene-noLen-rel,lucene-noLen-rr,lucene-noLen-rel
  AZ92SE5L1P238,male,lucene-noLen-rel,lucene-noLen-rr,lucene-noLen-rr 
  
  A2ZBU2WW9WHXB7,male,lucene-std-rel,lucene-noLen-rr,lucene-std-rel
  A1DGNCZZWELLVX,male,lucene-std-rel,lucene-noLen-rr,lucene-noLen-rr
  </pre>
  
  <p>the output results should be as below:</p>
  
  <pre>
  compare: lucene-std-rel      random     
  result: lucene-std-rel-->2           random--> 0        draw (choose both)--> 0 
  
  compare: lucene-noLen-rel    lucene-noLen-rr    
  result: lucene-noLen-rel=1   lucene-noLen-rr =1     draw=0
  
  compare: lucene-std-rel lucene-noLen-rel    
  result: lucene-std-rel= 1    lucene-noLen-rel=1     draw=0.
  </pre>
  
  <p>my code: it seems just count if user choose either sysA, sysB or both without considering the pair of string.</p>
  
  <pre><code>for($i=0;$i&lt;@query;++$i) {
  if ( $field[1] eq $query[$i] ) {
      if ( $field[4] eq $field[2]) {
      print "$query[$i]: $field[4]\n";
      $counta++;
      } 
      if ( $field[4] eq $field[3]) {
      print "$query[$i]: $field[4]\n";
      $countb++;
      }
      if ( $field[4] eq ($field[2] &amp;&amp; $field[3])) {
      print "$query[$i]: $field[4]$field[3]\n";
      $countc++;
  
  }
  </code></pre>
  
  <p>any help is very much appreciated. </p>