title: Converting string to number “Argument isn’t number error”
body: <p>I’m parsing tab delimited files.  Several columns are not being recognizes as numbers even though they are clearly numeric.  When I try to sum up these values errors are display : <code>Argument ""97"" isn't numeric in addition (+)</code> and Perl returns 0. </p>
  
  <p>I’ve tried using <code>Scalar::Util qw(looks_like_number);</code> but it produced the same result '0'. Is there something else I can try?</p>
  
  <p>Here is the code:</p>
  
  <pre><code>open my $out_fh, '&gt;', $final_variants or die qq{Unable to open "$final_variants" for output: $!};
  
  open my $in_fh, '&lt;', $tsv_file_new
              or die qq{Unable to open "$tsv_file_new" for input: $!};
  
  while ( &lt;$in_fh&gt; ) {
  
          my @fields = split;
  
          my $forward_reference = $fields[67];
          my $reverse_reference = $fields[68];
          my $forward_variant_reads = $fields[77];
          my $reverse_variant_reads = $fields[78];
  
          my $total_reads = (looks_like_number($forward_reference))
                  + (looks_like_number($reverse_reference))
                  + (looks_like_number($forward_variant_reads))
                  + (looks_like_number($reverse_variant_reads));
  
          my $current_final_line = $headerline . "\t"
                      . $forward_reference . "\t"
                      . $reverse_reference . "\t"
                      . $forward_variant_reads . "\t"
                      . $reverse_variant_reads . "\t"
                      . $total_reads . "\t";
  
          print $out_fh $current_final_line, "\n";
  }
  </code></pre>