title: Perl : Write array to text file
body: <p>This question is related to Perl, writing array to a text file.</p>
  
  <p>I open a filename_1 and store the content of this file to an array.
  Then I write this array to the filename_2.
  If I don't modify this array. I expect that the filename_2 is exactly the same as the filename_1.</p>
  
  <p>Instead, I see an extra line at the end of filename_2. Can someone help me?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>open( Fh, "&lt;", "filename_1.txt") or die "Cannot open for read";
  my @l_file_content_array = &lt;Fh&gt;;
  close Fh;
  
  open( Fh2, "&gt;", "filename_2.txt") or die "Cannot open for write";
  print Fh2 @l_file_content_array;
  close Fh2;
  </code></pre>