title: How to remove invisible new line characters in Perl
body: <p>I am writing a shell script in perl that takes values from two databases and compares them. When the script is finished it outputs a report that is supposed to be formatted this way:</p>
  
  <p>Table Name   Date   value from Database 1   value from Database 2   Difference</p>
  
  <p>The output is printed into a report file, but even when it is output to the command console it looks like this:</p>
  
  <pre><code>tablename    2017-06-20  7629628
   7629628
   0
  </code></pre>
  
  <p>Here's my code that makes the string then outputs it to the file:</p>
  
  <pre><code>$outputstring="$tablelist[0]    $DATErowcount0[$output_iteration]  $rowcount0[$output_iteration] $TDrowcount0[$output_iteration] $count_dif\n";
  print FILE $outputstring;
  </code></pre>
  
  <p>There seems to be a newline character hidden after $rowcount0[$output_iteration] and before $count_dif. What do I need to do to fix this/print it all in one line?</p>
  
  <p>To fill the arrays with values, values are read from files created by SQL commands.</p>
  
  <p>Here's some of the code:</p>
  
  <pre><code>`$num_from_TDfile=substr $r2, 16;
  $date_from_TDfile = substr $r2, 0, 12;
  $TDrowcount0[$TDnum_rows0]=$num_from_TDfile;
  $DATETDrowcount0[$TDnum_rows0]=$date_from_TDfile;
  $TDnum_rows0=$TDnum_rows0+1;`
  </code></pre>