This question is related to Perl, writing array to a text file.
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.
Instead, I see an extra line at the end of filename_2. Can someone help me?
Here is my code:
open( Fh, "<", "filename_1.txt") or die "Cannot open for read";
my @l_file_content_array = <Fh>;
close Fh;
open( Fh2, ">", "filename_2.txt") or die "Cannot open for write";
print Fh2 @l_file_content_array;
close Fh2;
diffthem, what is the difference?