$text = "file1.txt"; open (DAT,">file2.txt"); print DAT "$text\n" or die $!;