title: splitting by whitespace and joining with dots creates multiple dots Perl
body: <p>I have a string where I want to split in by whitespace. and then join it with a dot. the split works fine but when joining I get additional dots. I know that the log file has tabs but I am splitting by whitespace so not sure the problem. Here it does split fine as you can see it prints @array as <em>lineswithspacesandtabs</em></p>
  
  <pre><code>my $line = 'lines with spaces   and     tabs';
  @array = split /\s/, $line;
  print @array;
  </code></pre>
  
  <p>but now I join them and it does not work</p>
  
  <pre><code>$joinedstring = join '.', @array;
  print $joinedstring;
  </code></pre>
  
  <p>prints <em>lines.with.spaces...and.....tabs</em></p>
  
  <p>please help.</p>