title: Syntax errors at line 24 and 26. I don't know why?
body: <p>syntax error at bioinfo2.pl line 24, near ");"
  syntax error at bioinfo2.pl line 26, near "}"
  Execution of bioinfo2.pl aborted due to compilation errors.</p>
  
  <pre><code>print "Enter file name......\n\n";
  chomp($samplefile = &lt;STDIN&gt;);
  open(INFILE,"$samplefile") or die "Could not open $samplefile";
  
  @residue_name= ();
  @residue_count= ();
  while($newline = &lt;INFILE&gt;) 
  {
      if ($newline =~ /^ATOM/)
      {
          chomp $newline;
          @columns = split //, $newline;  
          $res = join '', $columns[17], $columns[18], $columns[19];
          splice @columns,0;
          $flag=0
          for ($i = 0; $i&lt;scalar(@residue_name); $i++;) 
          {
              if (@residue_name[i] == $res)
              {
                  @residue_count[i] = @residue_count[i] + 1;
                  $flag=1;
  
              }
          }
          if($flag==0)
          {
              push(@residue_name, $res);  
          }
  
          for ($i = 0; $i&lt;scalar(@residue_name); $i++) 
          {   
              print (@residue_name[i], "-------", @residue_count[i], "\n");
          }
      }   
  }               
  </code></pre>